Share via


SharepointListAdapter2.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 SharepointListAdapter2

instance.Query()
void Query()

Implements

SharepointListAdapter.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 named "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

SharepointListAdapter2 interface

SharepointListAdapter2 members

Query overload

Microsoft.Office.Interop.InfoPath namespace