Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
QueryAdapter property
Collapse the table of content
Expand the table of content

DataObject.QueryAdapter property

Gets a reference to the data adapter object that is used for a secondary data source.

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

Object QueryAdapter { get; }

Property value

Type: System.Object

After you have set a reference to the data adapter object that the QueryAdapter property returns, you can use the properties and methods that the particular data adapter object contains.

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 QueryAdapter property of the DataSourceObject object is used to return a reference to the data adapter that is associated with the DataSourceObject object, which, in this case, is an ADOAdapter data adapter object. The code then uses the Command property of the ADOAdapterObject object to display the SQL command text in a message box:

ADOAdapter adapter;
adapter = (ADOAdapter) thisXDocument.DataObjects["CityList"].QueryAdapter;
thisXDocument.UI.Alert("SQL command text: " + adapter.Command);
© 2015 Microsoft