Partager via


SPList.AddItem - Méthode

Creates a list item in the root folder of the list.

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

Syntaxe

'Déclaration
Public Function AddItem As SPListItem
'Utilisation
Dim instance As SPList
Dim returnValue As SPListItem

returnValue = instance.AddItem()
public SPListItem AddItem()

Valeur renvoyée

Type : Microsoft.SharePoint.SPListItem
The new item.

Remarques

To add an item to a list, first call the AddItem method to create a nonfolder list item with an automatically generated name in the root of the list. Then use indexers on the returned SPListItem object to assign specific values for each field of the item. Finally, call the Update method on the SPListItem object to write the changes to the database.

Important

The new item is not actually added to the list until you save it to the content database by calling the SPListItem.Update method.

Voir aussi

Référence

SPList classe

SPList - Membres

AddItem - Surcharge

Microsoft.SharePoint - Espace de noms

Add()