The text of this article is not in this database — only its details are. Read it on the old site: Create, Update, Delete a List Using Client Object Model (CSOM) SharePoint 2013
6 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

Aamir NizamPosted Sep 11, 2018, 6:39 AM
In Delete List Item, Please correct your code. ListItem oListItem = oList.GetItemById(); Pass the item id here. I think its a typo mistake.
Jaffer HussainPosted Apr 11, 2018, 7:32 AM
Completely new to SP development here. In your snippets there is no mention of credentials or signing in, What about authenticating access? Is this applicable to SP server 2013 meaning the C# app uses native AD authentication and logs in as your user?
Prashant VermaPosted Mar 8, 2016, 8:28 AM
but nicely explained sagar
Prashant VermaPosted Mar 8, 2016, 8:28 AM
same here
Graf ReinerPosted Sep 4, 2015, 12:40 PM
That didn't work for me, here is my altered code that did work. Kept getting a 403 error: Some includes you will need: using Microsoft.SharePoint; using SP = Microsoft.SharePoint.Client; using Microsoft.SharePoint.Client; using System.Net; using System.Security; SecureString password = new SecureString(); foreach (char c in "MYPASSWORD".ToCharArray()) password.AppendChar(c); string siteUrl = "https://mydomainname.sharepoint.com/sites/Sandbox"; ClientContext clientContext = new ClientContext(siteUrl); clientContext.Credentials = new SharePointOnlineCredentials("[email protected]", password); SP.List oList = clientContext.Web.Lists.GetByTitle("TitleName"); //Enter the name of the List's Title.. ListItemCreationInformation listCreationInformation = new ListItemCreationInformation(); ListItem oListItem = oList.AddItem(listCreationInformation); oListItem["FirstName"] = textBox1.Text; // FirstName is a column in the list oListItem.Update(); clientContext.ExecuteQuery();