Save data from infopath to SQL database - InfoPath Dev
in

InfoPath Dev

Save data from infopath to SQL database

Last post 11-20-2005 04:32 AM by whapakk. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-26-2005 11:48 AM

    Save data from infopath to SQL database

    How I make to send the inserted data in the Form for my connection of data base (SQL)?
  • 09-28-2005 06:58 AM In reply to

    Re: Save data from infopath to SQL database

    Hi,
    There are three option here,
    1. Take primary dataconnection to the database table. With this connection you can insert rows into the table, modify rows in the table and delete rows in the table.

    2. Write a Webservice method which takes your data as input and saves back to database.

    3. Write .net code to connect to Database using SQLConnection and save values to DB. But this connection needs full trust to your form.

    Agni
    InfoPath Dev India
  • 11-17-2005 09:30 PM In reply to

    • whapakk
    • Not Ranked
    • Joined on 09-23-2005
    • Philippines
    • Posts 22

    Re: Save data from infopath to SQL database

    Hi Agni,
    I have already deployed my form. It takes the filled out form and saves the document to a sharepoint site, simple. I didnt use dataconnections except for the secondary sql datasources for dropdownlists. Now they added a new requirement that it has to be able to save the form data to SQL. Is there any easy way of doing this without changing the primary datasource because form has lots of rules that will need to be rewritten. I can use the 3rd option in your list but I don't think I can make my form fully trusted. Any ideas? Thanks.

    btw, I used managed C#

    quote:
    Practice makes perfect, but then, nobody's perfect. So, why practice?
  • 11-18-2005 12:49 AM In reply to

    Re: Save data from infopath to SQL database

    Hi,
    There one thing that you can try here,
    1. Take regular secondary dataconnection, which gets the data.
    2. When you are submitting the form, change command of your dataconnection to insert values into DB. Now query the dataconnection.
    See if this works!
    3. Other things you can try is to write a stored proc to insert values to DB and set this as command to the secondary dataconnection and query the dataconnection.

    Try these out and let me know if it works?



    Agni
    InfoPath Dev India
  • 11-20-2005 04:32 AM In reply to

    • whapakk
    • Not Ranked
    • Joined on 09-23-2005
    • Philippines
    • Posts 22

    Re: Save data from infopath to SQL database

    quote:

    2. When you are submitting the form, change command of your dataconnection to insert values into DB. Now query the dataconnection.
    3. Other things you can try is to write a stored proc to insert values to DB and set this as command to the secondary dataconnection and query the dataconnection.



    Sorry but can you explain a bit more about the 'command' of the dataconnection. I tried something but I don't know if it's the same.
    I added a new dataconnection and on the wizard, I trashed the generated SQL statement and wrote my own. But all it can do is retrieve custom data. For SQL statements with parameters I don't know how I'll be able to pass them when I query the dataconnection.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.