_XDocument2.DataAdapters property

Office 2013 and later

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

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

DataAdaptersCollection DataAdapters { get; }

Important noteImportant

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.

In the following example, the DataAdapters property of the XDocument object is used to set a reference to a data adapter called "Main query":

object objDataAdapter;
objDataAdapter = thisXDocument.DataAdapters["Main query"];