Share via


_XDocument4.DataAdapters property

Gets a reference to the DataAdaptersCollection collection that is associated with a Microsoft InfoPath form.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
ReadOnly Property DataAdapters As DataAdaptersCollection
    Get
'Usage
Dim instance As _XDocument4
Dim value As DataAdaptersCollection

value = instance.DataAdapters
DataAdaptersCollection DataAdapters { get; }

Property value

Type: Microsoft.Office.Interop.InfoPath.DataAdaptersCollection
Returns DataAdaptersCollection.

Implements

_XDocument3.DataAdapters

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 Data tab. 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.

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)

See also

Reference

_XDocument4 interface

_XDocument4 members

DataAdapters overload

Microsoft.Office.Interop.InfoPath namespace