Showing posts with label Add item to splist. Show all posts
Showing posts with label Add item to splist. Show all posts

Tuesday, 13 March 2012

Add item to splist

Here is the code snippet:


using(SpSite site=new SPSite("Server"))
{
using(SpWeb web=site.OpenWeb())
{
SpList list=web.Lists["ListName"];
SpListItem item=list.Items.Add();

item["Title"] = "testTitle";
item["Description"]="test"; 
item.Update();
}
}

Enjoy

Pages

Followers