Fetch record from sharepoint online to sql server

How to fetch data from sharepoint online to sql server table using windows console application ?

Please share code sample....

Last updated:6/7/2018 2:58:51 AM

1 Answers

Prakash nidhi Verma
Prakash nidhi Verma

You should use of microsoft.sharepoint for access data into a datatable for easy calling by using this below class. 

Method for calling into Database :  

DataTable x = new DataTable(); 
x = ClassName.GetList("http://your site URL", "List table name");

Fetching data in DB from console application and create a new new list item by this below code : 

Clientdata data = new Clientdata Data("http://SiteUrl");  
//list name "mindstick"
List mindstickList = data.Web.Lists.GetByTitle("mindstick");
// creating a regular list item
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem newItem = mindstickList.AddItem(itemCreateInfo);
newItem["Title"] = "Unleash your Imagination";
newItem["Body"] = "Software Development";
newItem.Update();
mindstick.ExecuteQuery();

I hope ,It would be helpful for you..

Happy Coding :)

Answer