Query by storeprocedure - InfoPath Dev
in

InfoPath Dev

Query by storeprocedure

Last post 06-30-2008 12:05 AM by Dromont. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-29-2008 11:52 PM

    Query by storeprocedure

    Hi, I have a big question for you. This is my code to query a store procedure on Sql Server 2005 

    var custid = XDocument.DOM.selectSingleNode("/dfs:myFields/my:NewCase/my:LastCustID").text;
    var plantid = XDocument.DOM.selectSingleNode("/dfs:myFields/my:NewCase/my:LastPlantID").text;
    var machineid = XDocument.DOM.selectSingleNode("/dfs:myFields/my:NewCase/my:LastMachineID").text;
    var richi = XDocument.DOM.selectSingleNode("/dfs:myFields/my:NewCase/my:Richiedente").text;
    var telrichi = XDocument.DOM.selectSingleNode("/dfs:myFields/my:NewCase/my:TelRichiedente").text;
    var contratto = XDocument.DOM.selectSingleNode("/dfs:myFields/my:NewCase/my:contratto").text;
    var scadenza = XDocument.DOM.selectSingleNode("/dfs:myFields/my:NewCase/my:ScadenzaContratto").text;
    XDocument.QueryAdapter.Command = 'execute "dbo"."aggiorna_contattiD "' + custid + ", " + plantid + ", "+ machineid + ", '"+ richi + "', '"+ telrichi + "', '"+ contratto + "', '"+ scadenza + "'";
    XDocument.Query();

     the FIRST time that I submit the form there's not problem. But when I open the form the second time and I try againt to submit I have this error: "Error Convenrting Datatype nvarchar to int". Why? The second submit it is not the same like the first? Thank you

  • 06-30-2008 12:05 AM In reply to

    Re: Query by storeprocedure

    I find the error: in my complete code "var custid" was emptied before the query and so the query doesnt work! Sorry!

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.