Client Object Model in SharePoint 2010
Client Object Model is introduced in SharePoint Foundation 2010, and does not require SharePoint Server 2010 to be installed. This is a new object model introduced in SharePoint 2010 which is aimed at making things easier for the developer when developing client-side applications for SharePoint 2010.
Let’s we take a look how to create a client side application using Client Object Model through C# programming language in .NET:
- Go to Visual Studio 2010.
- Go to File à New à Project.
- Select Windows Application and apply the following settings to your project:
Target Framework: .NET 3.5
Build output: AnyCpu (or x64)
- Click Add.
Next, we need to add references to the Client Object Model in order to be able to work with the client-side APIs from our Windows Application.
Right click the “References” node and choose “Add Reference”
· Choose Browse:
· Go to the following location: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI.
· Select these two files:
Add the following controls in your Windows Application Form:
· A new ListBox control
· A new Button control
After adding controls add the following code in the Form1.cs file:
using SharePoint = Microsoft.SharePoint.Client;
public partial class Form1 : Form
private void btnDispList_Click(object sender, EventArgs e)
using (SharePoint.ClientContext objClientContext = new
var objWeb = objClientContext.Web;
foreach (SharePoint.List objlist in objWeb.Lists)
When you run this application and click on button (Display List) it will look something like this:
Thanks for reading this article. I think this will help you a lot when you create your first Client Object Model application to access SharePoint server in C#.