SPList.GetItemById - Méthode

Gets the list item with the specified identifier (ID).

Espace de noms :  Microsoft.SharePoint
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
Public Function GetItemById ( _
    id As Integer _
) As SPListItem
'Utilisation
Dim instance As SPList
Dim id As Integer
Dim returnValue As SPListItem

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

Paramètres

  • id
    Type : System.Int32

    The item ID. This value is not the index of the item within the collection of items for the list, but the value of the ID property of the list item.

Valeur renvoyée

Type : Microsoft.SharePoint.SPListItem
The list item with the specified ID.

Exceptions

Exception Condition
ArgumentException

The list item does not exist.

- ou -

The list is not a user information list.

Remarques

This method retrieves data for all fields of the specified item, which can have a significant impact on performance. To retrieve the data for only some fields, call the GetItemByIdSelectedFields(Int32, []) method with the desired fields.

Voir aussi

Référence

SPList classe

SPList - Membres

Microsoft.SharePoint - Espace de noms