SPQuery class

Represents a query in a list view.

System.Object
  Microsoft.SharePoint.SPQuery

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

No code example is currently available or this language may not be supported.

The Type attribute is particularly useful for Lookup and User fields. Otherwise, without that attribute, the query may not return the expected results. In some cases, the query may fail completely.

For information about how to use Language-Integrated Query (LINQ) queries to retrieve list items in SharePoint Foundation, see Managing Data with LINQ to SharePoint.

The following code example displays the titles of items in a Tasks list where the Status column equals Completed. The example uses Collaborative Application Markup Language (CAML) to define the query.

This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint and Microsoft.SharePoint.Utilities namespaces.

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: