Submit to sql database (via webservice) through secondary data connection ! - InfoPath Dev
in

InfoPath Dev

Submit to sql database (via webservice) through secondary data connection !

Last post 02-23-2010 02:07 PM by naydencho. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-02-2008 12:00 PM

    Submit to sql database (via webservice) through secondary data connection !

     Can any one  please list the steps to be followed to enable submitting a form through

    a secondary data connection. i.e creating a submit connection after I created the  layout of the form.

     

    Thanks,

    Swetha 

  • 08-03-2008 11:27 AM In reply to

    Re: Submit to sql database (via webservice) through secondary data connection !

    You need to know the URL to the web service but then it is just running through the data connection wizard.

  • 08-04-2008 05:35 PM In reply to

    Re: Submit to sql database (via webservice) through secondary data connection !

    Clay,

    Thanks for your response!

    As you mentioned, I have the URL for the Web Service and ran through the Data Connection wizard, to no luck. Let me elaborate:

    My objective is to Submit data to a MS SQL backend via Web Services using a Secondary Data Source. For the sake of conversation, the database has one table with 2 columns - id(int), name(char(10)). The Web Method to SubmitData is as follows:

        [WebMethod]
        public void SetDataSet(DataSet1 Data)
        {
            if (Data.HasChanges())
            {
                sqlDataAdapter1.Update(Data.tblOne);
            }
        }

    You can find the rest of the code here: http://pastebin.unl.edu/1401

    From Infopath, I create a new group called grpSubmit under myFields and it appears as follows:
     
    -myFIelds
     |-- dataFields
     |   |---tns:SetDataSet
     |         |--Data
     |           |--ns1:DataSet1
     |             |--(Choice)
     |                |--tblOne
     |                     |---id (of type int)
     |                     |---name (of type string))
     |--grpSubmit      <--- Custom created
          |--idSubmit (of type int)
          |--nameSubmit (of (of type string)

    For a Data Source of type "Submit Data" using Web Services, how can I associate a custom created non-repeating field (idSubmit, nameSubmit) under a custom created group (grpSubmit) to a repeating-field (id, name) that is available in myFields ?

    I intend to a create a form using non-repeating controls (text box) bound to the non-repeating fields idSubmit and nameSubmit. Using a secondary data connection that I created to talk to the Web Service, I want to commit the values that the user entered in the text boxes to the database via the web service.

    The submit process works fine when I use the repeating controls and use the Main Data Connection, but fails when I create custom fields, non-repeating controls and update them using a Secondary Data Connection.

    The real database schema along with the forms involved limits me from using the Main Data Connection for submit.

    Thanks,
    Swetha
  • 01-21-2010 10:54 PM In reply to

    • JobeS
    • Not Ranked
    • Joined on 01-22-2010
    • Posts 2

    Re: Submit to sql database (via webservice) through secondary data connection !

     

  • 01-21-2010 11:01 PM In reply to

    • JobeS
    • Not Ranked
    • Joined on 01-22-2010
    • Posts 2

    Re: Submit to sql database (via webservice) through secondary data connection !

    I am quit new on development. I am required to create a submit connection, to submit InfoPath data to SQL Server via Web Services. I am not sure where to start. Can anyone give the related books or maybe site to read and get maybe the guide to do it?
  • 01-25-2010 01:57 PM In reply to

    Re: Submit to sql database (via webservice) through secondary data connection !

    You can use this book : "Designing Forms for Microsoft Office Infopath and Forms Services 2007" -Scott Roberts ,Hagen Green.

    Chapter 8 in this book talks about submitting data from an Infopath form.

    For submitting data to SQL server database through a web service you would need to create a ADO.NET dataset submit , also mentioned in this chapter.

    Hope this helps.

     -Swetha

  • 02-23-2010 02:07 PM In reply to

    Re: Submit to sql database (via webservice) through secondary data connection !

    swetha,

    Did you ever find a solution to your question? I have a similar task and I am trying to find out if this is even possible... In my case I have a repeating table that pushes/pulls data from a web service using DataSet. It works fine if I setup the web service as the Main Datasource, but if it is the secondary I cannot get InfoPath to send the DataSet to the web service. it almost seems like DataSets are limited to use in the Main Datasource... But I cannot find definitive posting anywhere that states that.

    Thanks

    Nayden

     

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