Fetching lists from SharePoint 2010 site using client object model

Creating the UI

1. Add a label

2. Add a textbox. Give any meaningful name I am leaving default name here.

3. A button. On click event of the button list names will be fetched.

4. A listbox control to bind the lists from SharePoint site.

Setting up the environment

Right click on the project .Click on the Application tab and change the Target framework type to .Net Framework 3.5


Add the references of below dll in the project.




After adding the dll, add below namespace


Now on the click event of btnGetLists write the below code

Code to Retrieve the Lists of SharePoint site

On click event of the button, write the below code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using SharePointclientObj = Microsoft.SharePoint.Client;

namespace WindowsFormsApplication1
    public partial class Form1 : Form
        public Form1()

        private void btnGetLists_Click(object sender, EventArgs e)
            //Get a context
             using (SharePointclientObj.ClientContext ctx = new SharePointclientObj.ClientContext(textBox1.Text))
                 //Get the site
                 SharePointclientObj.Web site = ctx.Web;
                 //Get Lists
                 //Fill List
                 foreach (SharePointclientObj.List list in site.Lists)




3 responses to “Fetching lists from SharePoint 2010 site using client object model”

  1. […] This post was mentioned on Twitter by Dhananjay Kumar, Dhananjay Kumar. Dhananjay Kumar said: http://bit.ly/htlJoe : Fetching lists from SharePoint 2010 site using client object model […]

  2. This engine was recently rebuilt, about 20K miles ago. It frequently went on long trips back and forth from Lompoc to Los Angeles every weekend (about 150 miles). It is a 1.7 engine with stock components, and stock fuel injection. The owner of the car was driving north on a somewhat cool day a few weeks ago.

  3. nice article.. What if you only want, all the information from one specific list? would that be just as easy ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com