If you want to receive data from a SQL table directly into a field in InfoPath then do the following. First, create a new library in your SharePoint site using the template ”Data connections library”:
![](http://1.bp.blogspot.com/_MoggOzETMOo/SiY5jzd9QOI/AAAAAAAAAx4/TVmdHbuihew/s400/dclibrary.gif)
Name the library like “SQLConnections” or something. (Choose not to display it in your QuickLaunch if you want to hide this library):
Open InfoPath and open the form in which you want your new data connection (or you can open a blank form and do the same thing there). Click on “Tools” and “Data connections” and create a new SQL database connection:
![](http://1.bp.blogspot.com/_MoggOzETMOo/SiY5dZH35eI/AAAAAAAAAxg/k6u2e1DaLDo/s400/connectdb.gif)
Select the database:
![](http://3.bp.blogspot.com/_MoggOzETMOo/SiY5dSn1XYI/AAAAAAAAAxY/aglp0PabAhY/s400/selecttable.gif)
Finish and your data connection is added. Now, click on “Convert” button:
![](http://3.bp.blogspot.com/_MoggOzETMOo/SiY5c2qn11I/AAAAAAAAAxI/MgLobQ0ld38/s400/convert.gif)
Enter the URL of your SharePoint site and the Data Connection library that you created before. Remove the “Forms/Allitems.aspx” at the end of the URL and replace that with a filename instead, for example “myconnection.udcx”:
When you finish, you’ll see that the “Convert” button is grey. Press Close to return to the form: