How to insert a new List Item using SharePoint Object Model
Here sample code to insert to a sharepoint list item
using(SPSite mySite = new SPSite("yourserver"))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
SPList interviewList = myWeb.Lists["listtoinsert"];
SPListItem newItem = interviewList.Items.Add();
newItem["interview"] = "interview";
newItem.Update();
}
}
| | Destin Joy author of How to insert a new List Item using SharePoint Object Model is from Pathanamthitta, India. Destin Joy says Hello Everyone, I am Destin Joy from India I have MCPD in SharePoint 2010, MCTS SharePoint 2010 application development and MCTS in SharePoint 2007. I am mostly working in core part of SharePoint (2010-2007) and passionate about new Microsoft technologies. Born and brought up in Kerala You can reach me @ Destin.Joy@hotmail.com | |
| | View All Articles |
|
Please enter your Comment
- Comment should be atleast 30 Characters.
- Please put code inside [Code] your code [/Code].
|
|
|
|
|
|
|