Partager via


Query Property

The Query property of the SPView class gets or sets a string that contains the query for the view.

Property Value

A string in Collaborative Application Markup Language (CAML) that contains the Where clause for the query.

Remarks

Setting a query with the Query property requires that the Update method be used for changes to take effect in the database.

Example

The following code example uses the Query property to return items where a specified field in the list contains values less than 1000.

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

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security