Query with InfoPath2010 and SQl Server - InfoPath Dev
in

InfoPath Dev

Query with InfoPath2010 and SQl Server

Last post 01-01-2012 09:57 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-29-2011 09:54 AM

    Query with InfoPath2010 and SQl Server

    Hey in Infopath im wondering if the following is possible

    1) I am able to pull First and Last name from a user via a webservice, and I prefill my First Name and Last Name textbox from this. (This works)

    2) Pull these prefilled details from textboxes, and use them in a SQL query in a Database to pull out value from another table i.e. select customerId from table x where firstname = 'valuefirstnameinfopath' and lastname = 'valuelastnameinfopath'

    3) Insert the retrieved identifier into a seperate SQL Server table ?

    Just confused what template/method to approach in infopath to achieve this ?

  • 01-01-2012 09:57 PM In reply to

    Re: Query with InfoPath2010 and SQl Server

    Hi Velnias2011 and welcome,

    2) You can filter your SQL queries using values from the form if you write code in the form or use a Web Service. Our common library, qRules, is an example of the former and I believe Hilary has blogged how to set this up via a command (i.e. you just inject qRules and use Rules to access qRules code that does the SQL query). We also have a Web Service called DBXL that shows how to do this and comes with a query builder that helps you construct the xpaths that will extract the data from your form into the query string. You can install free trials of both.

    3) You can map your data to SQL if the form is created from SQL tables from scratch. However, that is not a best practice because it limits your ability to modify the form down-the-road and it doesn't work for browser-based forms. We recommend using a Web Service here and in fact the DBXL Web service mentioned above will submit your XML to a SQL table or set of tables.

    So, in summary, you can do both 2) and 3) but you will need to do some coding or look into third-party tools.

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