Partilhar via


How to: Create and Use a Data Connection Library

Applies to: SharePoint Server 2010

A Data Connection Library in Microsoft SharePoint Server 2010 is a library that can contain two kinds of data connections: an Office Data Connection (ODC) file or a Universal Data Connection (UDC) file. Microsoft InfoPath 2010 uses data connections that comply with the Universal Data Connection (UDC) file schema and typically have either a *.udcx or *.xml file name extension. Data sources described by these data connections are stored on the server and can be used in standard form templates and browser-enabled form templates.

Procedures

Uploading data connection files to a Data connection library enables InfoPath form templates to use the data sources described by these files to retrieve and submit information.

To create a SharePoint Data Connection Library

  1. Browse to an SharePoint Server 2010 site on which you have at least Design permissions. If you are on the root site, create a new site before you continue with the next step.

  2. On the Site Actions menu, click More Options.

  3. On the Create page, click Library under Filter By, and then click Data Connection Library.

  4. On the right side of the Create page, type a name for the library, and then click the Create button.

  5. Copy the URL of the new data connection library.

To create a new data connection file in InfoPath

  1. Open InfoPath Designer 2010, click Blank Form, and then click Design Form.

  2. On the Data tab, click Data Connections, and then click Add.

  3. In the Data Connection Wizard, click Create a new connection to, click Receive data, and then click Next.

  4. Click the kind of data source that you are connecting to, such as Database, Web service, or SharePoint library or list, and then click Next.

  5. Complete the remaining steps in the Data Connection Wizard to configure your data connection, and then click Finish to return to the Data Connections dialog box.

  6. In the Data Connections dialog box, click Convert to Connection File.

  7. In the Convert Data Connection dialog box, enter the URL of the data connection library that you previously copied (delete "Forms/AllItems.aspx" and anything following it from the URL), enter a name for the data connection file at the end of the URL, and then click OK. It will take a few moments to convert and save the data connection file to the library.

  8. Confirm that the data connection was converted successfully by examining the Details section of the Data Connections dialog box while the name of the converted data connection is selected.

  9. Browse to the SharePoint data connection library, click the drop-down next to the name of the data connection, click Approve/Reject, click Approved, and then click OK.

To use a data connection file in InfoPath

  1. Open InfoPath Designer 2010, click Blank Form, and then click Design Form.

    Note

    If you want to use a data connection file to specify the main data source of a form template, you can use only a file that specifies a Database or Web service connection. To specify the main data source from one of these kinds of connections, click Data Connection File instead of Blank Form, and then proceed to step 3.

  2. On the Data menu, click Data Connections, and then click Add.

  3. In the Data Connection Wizard, click Search for connections on a Microsoft Office SharePoint Server, and then click Next.

  4. If the site where you created your data connection library is not listed in the Site drop-down list, click Manage Sites, and then click Add to add it to the list.

  5. Select the site where you created your data connection library in the Site drop-down list, expand the name of the data connection library, select the data connection, and then click Next.

  6. Complete configuring the data connection in the Data Connection Wizard as required for the kind of connection that you have selected, click Finish, and then close the Data Connections dialog box.

  7. When finished, add some controls to the form, and then Preview the form to ensure that data is returned.

See Also

Concepts

About Data Connections, Authentication, and Alternate Access Mapping