Ado.net Data service (REST) Sample

Start with a blank SharePoint site and create three lists, all of them based on the “Custom List” template.

• Artists with just one column: Title

• Albums: add a look up column pointing to Artists.Title

• Songs: add two lookup columns, pointing to Artists.Title and Album.Title

http://bruce-pc/_vti_bin/ListData.svc returns all lists available on this site.

Metadata of all lists
http://bruce-pc/_vti_bin/ListData.svc/$metadata

Return all artists:
http://bruce-pc/_vti_bin/ListData.svc/Artists

Return the 1st artist:
http://bruce-pc/_vti_bin/ListData.svc/Artists(1)

Return all artisits, order by title
http://bruce-pc/_vti_bin/ListData.svc/Artists?$orderby=Title

Return top 3 songs
http://bruce-pc/_vti_bin/ListData.svc/Songs?$top=3

Skip the first 3 and return the next 3
http://bruce-pc/_vti_bin/ListData.svc/Songs?$skip=3&$top=3

you can continue to stack as many of these actions as you want.

Use filter:

http://bruce-pc/_vti_bin/ListData.svc/Songs?$filter=Title eq ‘Careless Whisper’

 
 

 
 

 
 

 
 


 
 

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: