| Home |

Accessing SQL Data Services (SDS) using ADO.NET Data Services (Astoria)

With the latest release of the SQL Data Services (SDS) we announced a tech preview of the work we did with ADO.NET Data Services (Astoria/adods) team (http://www.microsoft.com/azure/sqllabs.mspx).  As part of this preview we made available a new SDS service head that supports a subset of conventions outlined by ADO.NET Data Services.  A number of people stopped at our PDC demo booth and ask for details.  Here are some of the answers.  Keep in mind that this is just a tech preview and can change in future service updates.

Scope

This preview version of adods service head supports GET, POST, PUT and DELETE requests within a container.  This means that you can use ADO.NET Data Services conventions to create, modify, query and delete entities within a container.  However, you cannot perform any operations on authorities or containers.  At this point we also don’t support cross-container operations.

Accessing adods service head

Accessing adods service head is very similar to accessing our existing soap head – all you need to do is add /adods/v1/ to the service URI:

https://<authorityID>.data.database.windows.net/adods/v1/

Since all requests have to be targeted at a single container, you will also have to specify the name of the container in the URL:

https://<authorityID>.data.database.windows.net/adods/v1/<containerID/

Any request that doesn’t specify a container will result in HTTP 501 Not Implemented error.

Querying SDS using ADO.NET Data Services conventions

·         Let’s start with a few simple queries.  The following query returns all entities within a container: https://<authorityID>.data.database.windows.net/adods/v1/<containerID>/Entities()

·         To retrieve a specific entity, you can specify its ID: https://<authorityID>.data.database.windows.net/adods/v1/<containerID>/Entities('entityID')

·         You can use $filter to filter the set returned to you: https://<authorityID>.data.database.windows.net/adods/v1/<containerID>/Entities()?$filter=Kind eq 'Books'

·         You can also order the set by using $orderby: https://<authorityID>.data.database.windows.net/adods/v1/<containerID>/Entities()?$filter=Kind eq 'Books'&$orderby=Title  You can also specify multiple orderby parameters as well as ascending or descending order.  If $orderby is not specified, the entities are ordered by Id. Note: $orderby option will not result in filtering of the entities set returned by the filter.  This means that a query with an $orderby clause will return the same number of entities as the same query without the $orderby.  It also means that all entities, including the ones which do not have the $orderby proprety, will be returned.

·         Finally, you can limit the number of results returned using $top: https://<authorityID>.data.database.windows.net/adods/v1/<containerID>/Entities()?$filter=Kind eq 'Books'&$orderby=Title&$top=10  As with REST and SOAP heads, SDS will return a maximum of 500 entities at a time.

System properties

All SDS entities have three system properties: Id, Kind and Version.  While it is possible to create and access flexible properties with the same names using REST or SOAP heads, it isn’t possible with adods head.  If “Kind”, “Id” or “Version” appear in the $filter or $orderby clauses, SDS will filter/order on the system properties.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
Print | posted on Friday, October 31, 2008 10:08 AM

Feedback

# re: Accessing SQL Data Services (SDS) using ADO.NET Data Services (Astoria)

left by Chris Wiederspan at 11/13/2008 12:01 PM Gravatar
Stan,

Can I use this adods service head as the URL for a Service Reference? I haven't gotten it to work yet.

Chris

# re: Accessing SQL Data Services (SDS) using ADO.NET Data Services (Astoria)

left by Stan Kitsis at 11/17/2008 10:23 AM Gravatar
Add Service Reference feature is not supported today because SDS doesn't have support for schemas. We are working on it, but meanwhile you have to manually write your client-side types and overlay them over the flex model.

Stan

# re: Accessing SQL Data Services (SDS) using ADO.NET Data Services (Astoria)

left by Stan Kitsis at 12/31/2008 11:41 AM Gravatar
John,

To create authorities and containers you can use SDS Explorer which ships as part of the SDK:

http://msdn.microsoft.com/en-us/library/cc752965.aspx

http://go.microsoft.com/fwlink/?LinkId=125708

You can also do it programmatically using either REST or SOAP API's:
http://msdn.microsoft.com/en-us/library/cc512397.aspx

Stan

# re: Accessing SQL Data Services (SDS) using ADO.NET Data Services (Astoria)

left by tiffany at 8/1/2009 8:36 AM Gravatar
provides the best Tiffany & Co jewelry, including Necklaces, Pendants, Bracelets, Earrings, Rings at the lowest prices.

# re: Accessing SQL Data Services (SDS) using ADO.NET Data Services (Astoria)

left by 24 inch bar stools at 10/24/2009 1:33 PM Gravatar
I always use Astoria,thank you for the tutorial.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: