Share via


_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

_XDocument2.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 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)

See also

Reference

_XDocument3 interface

_XDocument3 members

DataAdapters overload

Microsoft.Office.Interop.InfoPath.SemiTrust namespace