Mein Blog

Aug 28, 2009 at 19:12 o\clock

Programmatically add items to SharePoint List

by: frx   Category: SharePoint

string strDashListRoot = "http://k2moss/atv/Lists/AssemblyList/";
using (SPSite site = new SPSite(strDashListRoot))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["AssemblyList"];
SPListItem Item = list.Items.Add();
Item["Title"] = "TEST";
Item.Update();
test.Text = Item.ID.ToString();
}
}