SPListItemCollection.GetItemById 方法

Returns the item with the specified integer ID from the collection.

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Function GetItemById ( _
    id As Integer _
) As SPListItem
用法
Dim instance As SPListItemCollection
Dim id As Integer
Dim returnValue As SPListItem

returnValue = instance.GetItemById(id)
public SPListItem GetItemById(
    int id
)

参数

  • id
    类型:System.Int32

    A 32-bit integer that identifies the item. The value of this parameter does not correspond to the index of the item within the collection of items for the list, but to the value of the ID property of theSPListItem class.

返回值

类型:Microsoft.SharePoint.SPListItem
An SPListItem object that represents the list item.

备注

The GetItemById method returns an ArgumentException exception if the item is not found.

另请参阅

引用

SPListItemCollection 类

SPListItemCollection 成员

Microsoft.SharePoint 命名空间