Query Method (DataObject Object)

Microsoft Office InfoPath

Reads data from the data adapter that is associated with the DataObject object and repopulates the DataObject object's associated XML Document Object Model (DOM).

expression.Query()

expression    Required. An expression that returns a reference to the DataObject object.

Security Level

2: 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.

Remarks

The Query method can be used to refresh the data contained in the XML DOM that is associated with a DataObject object.

Example

In the following example, the Query method of the DataObject object is used to refresh the data contained in the XML DOM associated with the DataObject object:

XDocument.DataObjects("CityList").Query();

After you have refreshed the data in the DataObject object, you can call the ForceUpdate method of the View object to synchronize the data contained in the DataObject object and the view:

XDocument.View.ForceUpdate();