Programmatically adding items to a SharePoint list
using(SPSite site = new SPSite(“http://”)) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists[“SharePointList”]; // you can use web.GetList method which is better for performance. SPListItem Item = list.Items.Add(); item[“Title”] = txtCompanyName.Text; // the text which need to update //can add required items В item.Update(); } } Note: 1. No need to use SPSecurity.RunWithElevatedPrivileges. […]
March 12, 2012
В·
Infoyen В·
One Comment
Tags: Add a List Item Programmatically in SharePoint, MOSS, Moss 2007, Programmatically insert an item in sharepoint list, SharePoint В· Posted in: List, MOSS, SharePoint