SPListItem.Delete Method

Deletes the item.

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

Syntax

'Declaration
<ClientCallableExceptionConstraintAttribute(FixedId := "4", Condition := "Operation is not supported.Cannot find the Entity Instance to delete.",  _
    ErrorType := GetType(InvalidOperationException))> _
<ClientCallableMethodAttribute(Name := "DeleteObject", RemoveThisObjectFromParentCollection := True)> _
<ClientCallableExceptionConstraintAttribute(FixedId := "thresholdexceeded", ErrorCode := , Condition := "Throttling limit is exceeded by the operation.",  _
    ErrorType := GetType(SPQueryThrottledException))> _
<ClientCallableExceptionConstraintAttribute(FixedId := "1", Condition := "Item does not exist. It may have been deleted by another user.",  _
    ErrorType := GetType(ArgumentException))> _
<ClientCallableExceptionConstraintAttribute(FixedId := "2", ErrorCode := , Condition := "Expanded recurrence items cannot be update.",  _
    ErrorType := GetType(SPException))> _
<ClientCallableExceptionConstraintAttribute(FixedId := "3", Condition := "User does not have permissions to update this list item.",  _
    ErrorType := GetType(UnauthorizedAccessException))> _
Public Overrides Sub Delete
'Usage
Dim instance As SPListItem

instance.Delete()
[ClientCallableExceptionConstraintAttribute(FixedId = "4", Condition = "Operation is not supported.Cannot find the Entity Instance to delete.", 
    ErrorType = typeof(InvalidOperationException))]
[ClientCallableMethodAttribute(Name = "DeleteObject", RemoveThisObjectFromParentCollection = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "thresholdexceeded", ErrorCode = , Condition = "Throttling limit is exceeded by the operation.", 
    ErrorType = typeof(SPQueryThrottledException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "1", Condition = "Item does not exist. It may have been deleted by another user.", 
    ErrorType = typeof(ArgumentException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "2", ErrorCode = , Condition = "Expanded recurrence items cannot be update.", 
    ErrorType = typeof(SPException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "3", Condition = "User does not have permissions to update this list item.", 
    ErrorType = typeof(UnauthorizedAccessException))]
public override void Delete()

Remarks

This method deletes the current list item from its store.

See Also

Reference

SPListItem Class

SPListItem Members

Microsoft.SharePoint Namespace