Share via


ISPWDataConnector.Query Method

Queries a table in the underlying data and returns a DataSet with all records matching the query.

Namespace:  Microsoft.Office.SharePointWorkspace.AddIn
Assembly:  Microsoft.Office.SharePointWorkspace.AddIn.Interface (in Microsoft.Office.SharePointWorkspace.AddIn.Interface.dll)

Syntax

'Declaration
Function Query ( _
    xml As String _
) As DataSet
'Usage
Dim instance As ISPWDataConnector
Dim xml As String
Dim returnValue As DataSet

returnValue = instance.Query(xml)
DataSet Query(
    string xml
)

Parameters

Return Value

Type: System.Data.DataSet
DataSet containing the records that matched the query.

Remarks

The XML schema for the Query element is defined in:

C:\Program Files\Microsoft Office\Office14\Groove\XML Files\spwaddin.xsd

if you have installed SharePoint Workspace in the default location.

The following is a sample XML query string:

<?xml version="1.0" encoding="utf-8"?>
<Query Name="Table1Query" TableRef="Table1" xmlns="https://schemas.microsoft.com/spw/">
  <ColumnRefs>
    <ColumnRef Name="Column1" />
    <ColumnRef Name="Column2" />
  </ColumnRefs>
  <Where>
    <EndsWith>
      <ColumnRef Name="Column2" />
      <Value>ing</Value>
    </EndsWith>
  </Where>
  <OrderBy>
    <ColumnRef Name="Column2" Ascending="True" />
  </OrderBy>
</Query>

The query Name determines the name of the returned DataSet. The query TableRef specifies the table to query.

See Also

Reference

ISPWDataConnector Interface

ISPWDataConnector Members

Microsoft.Office.SharePointWorkspace.AddIn Namespace