SharePoint 2013 Basic Operations Using CSOM - Delete List

Introduction

SharePoint 2013 is a browser-based collaboration and document management platform and widely used in a many organization.SharePoint is like a document repository as secure place to store, organize, share, and access information from almost any device.

SharePoint 2013 e can store all types f documents,pages,linkes etc...

SharePoint 2013 we dont need any separate software to install on a customer place its like browser based plat form and we can use it in a anyplace anywhere.

Now sharepoint having main two platforms andit can be quickly explained below,,

  • SharePoint Online
  • SharePoint Server

SharePoint Online is a cloud-based service, hosted by Microsoft and we can use it in O365 .

SharePoint Server is a platform to maintain by us and we have to maintain all depployment and maintaince support.

Microsoft says, SharePoint 2013 as Collaboration, Portal, Search, Enterprise Content Management (ECM) , Business process management (BPM) and Business intelligence (BI) etc.

Here my tutorial is to explain about how we can use SharePoint 2013 in a Programmatically and if you know the SharePoint 2013 OOTB methods well.

In this article i would perform basic operations with the SharePoint 2013 .NET Framework client object model (CSOM).

SharePoint 2013 Supports below API methods to perform basic operations like Create ,update ,read and Delete .

  1. Server side Object Model (SSOM)
  2. CLient Object Model(CSOM)
  3. Javascript Object MOdel(JSOM)
  4. REST

Server SIde objectmodel is pure .net code but here using Client object ,model to perform all basic operation in sharepoint 2013 to achive all this.

Prereuists to perform this operations.

  • Visual studio 2012
  • SharePoint 2013

Before start to develop the code we have to add dll assembly reference .

  1. SharePoint.Client.Runtime.dll
  2. SharePoint.Client.dl

And add below line in your namespace,

using Microsoft.SharePoint.Client;

Now we are going to see how to create a list in sharePoint 2013 Programmatically,

Client Object model we will use this below class to interact with the objects within your site, such as the current Web object, the parent Site object, and a Lists collection once we use this ExecuteQuery method on the ClientContext instance.

Open your Visual Studio 2012 in your system and click New Project link,


once opened your visual studio add dll reference here,


Then Copy and Paste your code here,


Click F5 to run this solution and open your SharePoint site,


Source Code 

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text.RegularExpressions;  
  5. using Microsoft.SharePoint.Client;  
  6. namespace Rextester {  
  7.     public class Program {  
  8.         public static void Main(string[] args) {  
  9.             ClientContext context = new ClientContext("http://gowtham.sharepoint.com");  
  10.             Web web = context.Web;  
  11.             List list = web.Lists.GetByTitle("Tutorial");  
  12.             list.DeleteObject();  
  13.             context.ExecuteQuery();  
  14.         }  
  15.     }  
  16. }   

Thanks for reading my articles...will continue in Tutorial 2..

Ebook Download
View all
Learn
View all