Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you Read SharePoint Lists Programmatically?

I currently use the Linq to SharePoint to retrieve data from several SharePoint lists.

This is my current preferred method of coding my way from ASP.NET and WinForms to retrieve this data.

My only issue with this project:

I have to manually generate the SPML file and add this to the development environment, compile it in the project, and only then I am able to use it to connect to the List.

This is great for projects that require connecting to the one and the same list always.

But I am having users creating new workspaces (sites) with each its own List from which I want to retrieve data automagically (same as linq to sharepoint does, but not statically).

Can you recommend your preferred way of accessing data from several SharePoint Lists and sites in C# WinForms and/or ASP.NET outside an actual SharePoint environment where I can specify the a new source site and list at run time?

like image 438
Ric Tokyo Avatar asked Jan 29 '09 09:01

Ric Tokyo


People also ask

How do I access programmatically in SharePoint?

acquire a list_id by a given list name (this step is very easy with CSOM) use the list_id to access page: https://{domain}.sharepoint.com/_layouts/15/listedit.aspx?List={list_id} (the list setting page according to the list ID) grab the whole page HTML content, then do some further GET/POST operations.

Is there an API for SharePoint?

SharePoint offers a rich set of APIs that can be consumed in various ways. This article outlines what options you have, how they work and what their advantages and disadvantages are.

How does REST API work in SharePoint?

REST API provides a flexible, lightweight way of interacting with SharePoint remotely by using any technology that supports REST protocol. With SharePoint API, you can easily perform basic Create, Read, Update, and Delete (also known as CRUD) operations.


1 Answers

You have several options both of which are going to require further research on your part they are:

  1. Use the SharePoint object model (Microsoft.Sharepoint.dll), you must be on a PC within the SharePoint farm.
  2. Use the SharePoint web services which can be found at SiteURL/_vti_bin/ you might want to start with Lists.asmx and work from there.

You are going to need some further research as I have said, but remember GIYF.

like image 199
Charlie Avatar answered Oct 04 '22 03:10

Charlie