---
title: "Fetch record from sharepoint online to sql server"  
description: "Fetch record from sharepoint online to sql server"  
author: "Satyaprakash Samantaray"  
published: 2018-05-25  
updated: 2018-06-07  
canonical: https://www.mindstick.com/forum/34494/fetch-record-from-sharepoint-online-to-sql-server  
category: "database"  
tags: ["sharepoint", "sql server 2012"]  
reading_time: 1 minute  

---

# Fetch record from sharepoint online to sql server

How to fetch data from [sharepoint](https://answers.mindstick.com/qa/115914/what-are-the-best-practices-for-managing-a-sharepoint-online-environment-migration) [online](https://www.mindstick.com/articles/13083/benefits-of-students-who-can-get-online-assignment) to sql [server table](https://www.mindstick.com/forum/396/how-to-selecte-random-records-from-sql-server-table) using [windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) [console application](https://www.mindstick.com/forum/160510/how-to-fetch-data-from-the-database-in-the-dot-net-console-application-using-c-sharp) ?\

Please share [code sample](https://www.mindstick.com/forum/33394/under-what-condition-could-the-code-sample-below-crash-your-application-how-would-you-modify-the-code-to-avoid-this-potential-problem)....\

## Replies

### Reply by 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](https://www.mindstick.com/blog/210/the-console-class) [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) 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 :)


---

Original Source: https://www.mindstick.com/forum/34494/fetch-record-from-sharepoint-online-to-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
