Lists.DeleteList method

Deletes the specified list.

Namespace:  WebSvcLists
Assembly:  STSSOAP (in STSSOAP.dll)

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/DeleteList", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub DeleteList ( _
    listName As String _
)
'Usage
Dim instance As Lists
Dim listName As String

instance.DeleteList(listName)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/DeleteList", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void DeleteList(
    string listName
)

Parameters

  • listName
    Type: System.String

    A string that contains either the title or the GUID for the list.

Examples

The following code example deletes a specified list from the current site.

Dim listService As New Web_Reference_Folder.Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials

listService.DeleteList("List_Name")
Web_Reference_Folder.Lists listService = new Web_Reference_Folder.Lists();
listService.Credentials= System.Net.CredentialCache.DefaultCredentials;

listService.DeleteList("List_Name");

See also

Reference

Lists class

Lists members

WebSvcLists namespace