Dear All,
How to start a SharePoint Client Object Model project in Visual studio - SharePoint 2010
I want to do a SharePoint task of updating a list, can somebody help me what are the basic steps to be
done in visual studio 2010 to execute this code
Which VSS project project template I should select ( console application, Empty project, windows application etc ????? )
File -> New -> Project ???????? which template I should select??????
static void Main(string[] args)
{
using (ClientContext clientContext = new ClientContext("http://mylocalhost/"))
{
Site siteCollection = clientContext.Site;
Web site = clientContext.Web;
List registration = site.Lists.GetByTitle("listsample");
ListItemCollection lItems = registration.GetItems(new CamlQuery());
clientContext.Load(lItems, items => items.Include(i => i["Itm1"], i => i["Itm2"], i => i["Itm3"]));
clientContext.ExecuteQuery();
foreach (ListItem item in lItems)
{
item["Itm2"] = "Success";
item.Update();
clientContext.ExecuteQuery();
}
}