0

I have list with approx 20000 items, and want to push that into sql table. Can anyone help me with c# code. Thanks

1
  • 1
    Please share your work. What you have tried so far ? Commented Jan 15, 2016 at 10:30

1 Answer 1

0

A simple solution will be to export the SharePoint list in excel and then import that data into SQL table using SQL management studio,

But still if you want to go by C#, then you can get all list items using below code and then insert into SQL table

using ( SPSite site = new SPSite ("http://moss/sites/yousitename"))
{

  SPWeb myWeb = site.OpenWeb();
  SPList target = myWeb.Lists["YourListName"];
  SPListItems items = list.Items;
  myWeb.Dispose();
 }

for more information check this link: https://social.msdn.microsoft.com/Forums/en-US/5d61926a-9a18-422f-a34a-dda3e8b3eab1/how-to-export-data-from-a-sharepoint-list-to-a-sql-database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.