Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SPList.GetDataTable method

Retrieves a data table that contains item data that satisfies a query.

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

public DataTable GetDataTable(
	SPQuery query,
	SPListGetDataTableOptions flags,
	out SPListItemCollectionPosition position
)

Parameters

query
Type: Microsoft.SharePoint.SPQuery

The query that will be used to select data. Only the fields that are specified in the query are returned.

flags
Type: Microsoft.SharePoint.SPListGetDataTableOptions

An enumeration value that specifies options for populating the data table with the values of fields in list items.

position
Type: Microsoft.SharePoint.SPListItemCollectionPosition

A reference to an object that will receive paging information.

Return value

Type: System.Data.DataTable
A data table that contains the result of the query. Each row in the table represents a list item that satisfies the query. Each column represents a field that was specified in the query.

ExceptionCondition
ArgumentNullException

The query parameter is a null reference。

Show:
© 2015 Microsoft