Monday 8 June 2015

Delete a SharePoint list using Client Side Object Model

C#  code to delete a SharePoint list.




// Starting with ClientContext, the constructor requires a URL to the 
// server running SharePoint. 
ClientContext context = new ClientContext("http://SiteUrl"); 

// The SharePoint web at the URL.
Web web = context.Web; 

List list = web.Lists.GetByTitle("My List"); 
list.DeleteObject(); 

context.ExecuteQuery(); 

No comments: