Thursday, December 9, 2010

Insert Data into Sharepoint using windows application

http://blog.the-dargans.co.uk/2007/04/programmatically-adding-items-to.html

SPSite oSiteCollection = new SPSite(“http://SiteName“);
SPWeb oWebsiteRoot = oSiteCollection.OpenWeb();

 oWebsiteRoot.AllowUnsafeUpdates = true;
 SPList oList = oWebsiteRoot.Lists["ListName"];
SPListItemCollection listItemCOll;
SPListItem oListItem = oList.Items.Add();
oListItem["FieldName"] = Value ....
oListItem.Update();

No comments:

Post a Comment