ViewXml Property

The ViewXml property of the SPQuery class gets or sets the XML schema that defines the view.

Property Value

A string that contains the view schema in Collaborative Application Markup Language (CAML).

Remarks

The ViewXml property contains a string that corresponds to the inner XML of the View element in CAML.

Example

The following code example uses the ViewXml property to define a query in CAML.

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

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security