_XDocument3.DataAdapters property
Gets a reference to the DataAdaptersCollection collection that is associated with a Microsoft InfoPath form.
Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
Syntax
'Declaration
ReadOnly Property DataAdapters As DataAdaptersCollection
Get
'Usage
Dim instance As _XDocument3
Dim value As DataAdaptersCollection
value = instance.DataAdapters
DataAdaptersCollection DataAdapters { get; }
Property value
Type: Microsoft.Office.Interop.InfoPath.SemiTrust.DataAdaptersCollection
Implements
Remarks
To use the object returned by a DataAdaptersCollection object, you must declare and cast to the corresponding type for the kind of data connection that is defined in the form template using the Data Connections command on the Tools menu. For example, to work with a data connection to a SharePoint list, you must declare and cast the object returned from the DataAdaptersCollection object to the SharepointListAdapterObject type as shown in the code sample.
Important
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
Examples
In the following example, the DataAdapters property of the XDocument object is used to set a reference to a data connection to a SharePoint list called "Contacts".
SharepointListAdapterObject myContacts =
(SharepointListAdapterObject)thisXDocument.DataAdapters["Contacts"];
Dim myContacts As SharepointListAdapterObject = _
DirectCast(_
thisXDocument.DataAdapters["Contacts"], _
SharepointListAdapterObject)