SPList.Delete Method

Deletes the list.

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

[ClientCallableExceptionConstraintAttribute(FixedId = "a", ErrorCode = , Condition = "This list cannot be deleted because it has related lists with relationship behavior constraints.", 
	ErrorType = typeof(SPException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "notsupported", ErrorCode = , Condition = "Recycle bin is disabled.", 
	ErrorType = typeof(SPException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "listuniquenotdeletable", ErrorCode = , 
	Condition = "The list can not be deleted.", ErrorType = typeof(SPException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "accessdenied", Condition = "User does not have permissions to update this list.", 
	ErrorType = typeof(UnauthorizedAccessException))]
[ClientCallableMethodAttribute(Name = "DeleteObject", RemoveThisObjectFromParentCollection = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "listnotfound", ErrorCode = , Condition = "The list is not found.", 
	ErrorType = typeof(SPException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "listnotdeletable", ErrorCode = , Condition = "The list can not be deleted.", 
	ErrorType = typeof(SPException))]
public void Delete()

This method also sets the status of the lists represented by the Lists property as modified.

Show: