I am adding a new splistitem to a sharepoint list but it always gives me an exception: "object refer
- by Manale
_site = new SPSite("http:\\MySite");
_web = site.OpenWeb();
{
list = _web.Lists[sListName];
_web.AllowUnsafeUpdates = true;
items = list.Items;
item = items.Add();
item["Title"] = "new Title";
item["UserName"] = CurrentUser.ToString();
item["Configuration"] = sConfiguration.ToString();
}
item.Update();
_web.AllowUnsafeUpdates = false;