Export (0) Print
Expand All

SPFile.GetListItem Method

Gets the SPListItem that corresponds to this file, if this file belongs to a document library. Also gets values for specified fields.

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

public SPListItem GetListItem(
	params string[] fields
)

Parameters

fields
Type: []

List of fields for which to get values. Sending a blank string causes none of the fields to be fetched. This parameter cannot be a null reference (Nothing in Visual Basic).

Return Value

Type: Microsoft.SharePoint.SPListItem
The list item that contains the file object.

This function is equivalent to SPFile.Item except that this version is more efficient because only specified field values are fetched.

Show:
© 2014 Microsoft