|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Represents a connection for retrieving data from a Microsoft Access or Microsoft SQL Server database.
Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
The class provides properties that can be used to get and set information about the data connection's connection string, SQL command text, and timeout value. It also provides a method for creating a SQL command text fragment based on a specified XML node's attributes.
When a form designer creates a new form template by using the Database template, and then specifies the database to connect to, an object for this connection is added to the DataConnectionCollection collection.
For both kinds of connection, the name of each connection is specified by the form designer in the Data Connection Wizard user interface. The default names assigned in the wizard for each kind of connection are "Main connection" (AdoQueryConnection) and "Main connection submit" (AdoSubmitConnection).