Share via


SharepointListAdapter.Query Method

Reads data from the associated data adapter.

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

Syntax

'Declaration
Sub Query
'Usage
Dim instance As SharepointListAdapter

instance.Query()
void Query()

Remarks

The Query method fails if the QueryAllowed property is false.

Examples

In the following example, the Query method of an existing Data Connection to a SharePoint list, "SharePoint list", is invoked. A message box is displayed if the Query method fails:

SharepointListAdapter SPList = ((SharepointListAdapter)thisXDocument.DataAdapters[“SharePoint list”]);
try
{
 SPList.Query();
}
catch (Exception ex)
{
 thisXDocument.UI.Alert("Failed to query.\n\n" + ex.Message);
}

See Also

Reference

SharepointListAdapter Interface

SharepointListAdapter Members

Microsoft.Office.Interop.InfoPath Namespace