Steps
- Open Visual Studio in your system
- Select Console Application template and give the name "Enablefolder"
- Add a Microsoft.Cleint Assembly reference file in right side reference tab in Visual Studio.
- Replace Program.cs with the source code given below.
- using System;
- using Microsoft.SharePoint.Client;
- namespace GowthamArticles
- {
- class CreateListItem
- {
- static void Main()
- {
- ClientContext clientContext = new ClientContext("https://gowtham.sharepoint.com/tutorials");
- List oList = clientContext.Web.Lists.GetByTitle("Announcements");
- ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
- ListItem oListItem = oList.AddItem(itemCreateInfo);
- oListItem["Title"] = "Test Item!";
- oListItem["Body"] = "This sample item created programmatically";
- oListItem.Update();
- clientContext.ExecuteQuery();
- }
- }
- }

Arun MenonPosted Nov 17, 2020, 1:46 PM
Hey ... please include the authentication part also, at the end unfortunately this article looks not useful.
Chandan DasPosted Feb 21, 2019, 10:34 PM
Wow... very helpful