Retrieving List Data using ADO.NET Data Services/REST

ADO.NET Data Service, or REST is just like SOAP/Web Services. With ADO.NET Data Services, you retrieve Sharepoint list data (or metadata) by referencing to an HTTP URL, with optional parameters.

Say you have a list called “Population” in your Sharepoint site:

The list has two columns: Country (text) and Population (number).

Here are a few ways you can retrieve information about the lost (or other lists) from the site. The data is returned to your browser as an XML file.

Get a list of all list names from your site

Get details of all lists from your site

Get list items in”Population”

Get list items in “Population”, order by “Population” column

Get list items in “Population”, but only return the top 2 list items.

Get list “Population”, but skip the first 2 list items.

Get list “Population”, order by “Population” column, but skip the first 2, and only return the top 2.

All these query are completed using the HTTP command “GET”. You can also “POST” (to create), “PUT” (to update), “DELETE” (to delete) and “MERGE”. It’s definitely worth it to buy a book on this.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: