follow the step here :
http://www.sharepointkings.com/2011/07/client-object-model-part-1.html
please remember to add the Microsoft.Sharepoint.Client and Microsoft.Sharepoint.Client.Runtime to References.
*my small step over the cilent object model over sp2010
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 Microsoft.SharePoint.Client;
namespace SP2010
{
public partial class Form1 : System.Windows.Forms.Form
{
public Form1()
{
InitializeComponent(); //not sure this is for what
}
public void LoadData()
{
string webUrl = "
http://xxxxx/sites/content/support"; //replace this with your site URL
ClientContext context = new ClientContext(webUrl);
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
this.label1.Text = web.Title + " " + web.Description;
this.label2.Text = webUrl;
}
private void button1_Click(object sender, EventArgs e)
{
LoadData();
}
}
}