Thursday, April 3, 2014

Access SQL Server data through InfoPath Form



1.       Create Data Connection Library in your site.


 








2. Data connection settings must be stored in a UDC file in a data connection library. So create and store .udcx file.

3.       Manage connection in InfoPath. Receive data -> Database -> Select Database -> New Source-> SQL Server -> Fill server name and Log on Credentials.
 

 
4.       Select Database and table you want to get data. Next and click on finished.


 
 
5.       Then Manage data connection -> Select data connection you created and click convert to connection file. Give path to data connection library.





















6.       Then manage data connection -> add -> Search for connection on a MS SP Server -> Manage site -> Give site details.-> select .udcx file -> Finish

7.       Design Your InfoPath Form.
8.       Rules -> Click New -> Action
9.       Click Add -> Query for data. Select the table and click OK.














10.   Click Add -> Set a fields value . For the Field give the customer first name field which is ‘field2′


 





11.   Click Filter Data -> Add . Create a filter such that The customer ID you input in the form is equal to the customer ID in the database. Click OK for everything.
















12.   After all changes publish your Info Path form. Now to check the form click preview or press F5. Enter a cutomer ID (provided it’s in your SQL database) and click the button.







Note: The amount of data that was returned by a data connection has exceeded the maximum limit that was configured by the server administrator. Form elements, such as drop-down lists, may be blank.

Click on General Application Settings in Central Administration
Click on Configure InfoPath Forms Services under InfoPath forms Services
Change the Response Size in kilobytes (Increase the number). 


















4 comments: