Share via


SPQuery.ViewFieldsOnly Property

Gets or sets a value that indicates whether to retrieve only the fields specified in the ViewFields property.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Property ViewFieldsOnly As Boolean
    Get
    Set
'Usage
Dim instance As SPQuery
Dim value As Boolean

value = instance.ViewFieldsOnly

instance.ViewFieldsOnly = value
public bool ViewFieldsOnly { get; set; }

Property Value

Type: System.Boolean
true to return only the fields specified as ViewFields; otherwise, false.

Remarks

When you specify fields by setting the ViewFields property, the query retrieves data for more than just those fields. To optimize performance, you can limit the data that is returned by the query by setting the ViewFieldsOnly property to true.

See Also

Reference

SPQuery Class

SPQuery Members

Microsoft.SharePoint Namespace