Steps
1. Open Visual Studio in your system.
2. Select Console Applciation template and give as name.
3. Add a Microsoft.Cleint Assembly refrence file in right side refrence tab in visual studio.
4. Replace Program.cs with the source code file.
4. Replace Program.cs with the source code file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint.Client;
namespace GowthamSamples
{
class Program
{
static void Main(string[] args)
{
// ClientContext - Get the context for the SharePoint Site
ClientContext ctx= new ClientContext("http://gauti.sharepoint.com/sites/sp1/");
/ Assume that the web has a list named "Gowtham"
List announcementsList = ctx.Web.Lists.GetByTitle("Gowtham");
// We are just creating a regular list item, so we don't need to
// set any properties. If we wanted to create a new folder, for
.
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem newItem = announcementsList.AddItem(itemCreateInfo);
newItem["Title"] = "Gowtham's test Item!";
newItem["Body"] = "Hello C# Corner Users!";
newItem.Update();
context.ExecuteQuery();
}
}
}