<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jeff's thoughts on Software Architecture, Large Scale Services and the Technical world at large : MIX08</title><link>http://blogs.msdn.com/jcurrier/archive/tags/MIX08/default.aspx</link><description>Tags: MIX08</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Some SQL Server Data Services Coding Examples</title><link>http://blogs.msdn.com/jcurrier/archive/2008/03/17/some-sql-server-data-services-coding-examples.aspx</link><pubDate>Mon, 17 Mar 2008 20:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8292420</guid><dc:creator>jcurrier</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8292420.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8292420</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8292420</wfw:comment><description>&lt;P&gt;Since my last post (just after we released the service) several others have written some really great stuff on SSDS.&amp;nbsp; I've listed these below for reference.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://dunnry.com/blog/EntitiesContainersAndAuthorities.aspx" mce_href="http://dunnry.com/blog/EntitiesContainersAndAuthorities.aspx"&gt;Overview of the ACE model&lt;/A&gt; from Ryan&lt;/P&gt;
&lt;P&gt;&lt;A href="http://dunnry.com/blog/SSDSQueryModel.aspx" mce_href="http://dunnry.com/blog/SSDSQueryModel.aspx"&gt;SSDS Query Syntax&lt;/A&gt;&amp;nbsp; (also from Ryan)&lt;/P&gt;
&lt;P&gt;However, most of the content has been focused on either conceptual material or our basic query syntax.&amp;nbsp; So, I wanted this post to be more on how to use our service from C# (I'll do a Java example next time around).&amp;nbsp; I'm only going to cover the REST head in this example but future examples will illustrate the use of our service from the SOAP head.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In this example, I'll construct a general purpose class to generate a WebRequest in C# and also another to read in the value.&amp;nbsp; Once this is complete we'll attempt to use these to do something interesting.&lt;/P&gt;
&lt;H3&gt;Knowing your verbs&lt;/H3&gt;
&lt;P&gt;The first thing we're going to do in this example is to define an enumeration which we we can use with our utility class to specify the HTTP verb that we want to use.&amp;nbsp; Listed below is a enumeration which we can use to do this.&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;enum&lt;/SPAN&gt; HttpMethods
    {
        GET = 0,
        PUT,
        POST,
        DELETE,
        HEAD,
        OPTIONS,
        LIST,
        UNKNOWN
    }&lt;/PRE&gt;
&lt;H3&gt;Generating Requests&lt;/H3&gt;
&lt;P&gt;So, now that we have our HTTP vocabulary down let's proceed in writing a simple method that we can use to create our WebRequest objects for us.&amp;nbsp; This should take care of setting things like the encoding, content-length and these sorts of details for us automatically so that we don't have to worry about this.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// This helper method can be used to create WebRequests for the caller.&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// It will populate the ContentType, ContentLength and Body for the caller.&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;param name="uri"&amp;gt;Target URI of the request.&amp;lt;/param&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;param name="method"&amp;gt;The HTTP method to use.&amp;lt;/param&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;param name="data"&amp;gt;The body of the request.&amp;lt;/param&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;param name="contentType"&amp;gt;The content type.&amp;lt;/param&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;returns&amp;gt;The created WebRequest.&amp;lt;/returns&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; HttpWebRequest CreateRequest(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; uri, 
                                           HttpMethods method, 
                                           &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; data, 
                                           &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; contentType)
{
    &lt;SPAN style="COLOR: #008000"&gt;// Begin by validating our inbound parameters.&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (String.IsNullOrEmpty(uri))
    {
        &lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; ArgumentOutOfRangeException("&lt;SPAN style="COLOR: #8b0000"&gt;uri&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Value cannot be null or empty.&lt;/SPAN&gt;");
    }

    &lt;SPAN style="COLOR: #008000"&gt;// Then, go ahead and create the request using the parameters that were passed in.&lt;/SPAN&gt;
    WebRequest request = HttpWebRequest.Create(uri);
    request.Method = Enum.GetName(&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;(HttpMethods), method);
    request.Credentials = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; NetworkCredential("&lt;SPAN style="COLOR: #8b0000"&gt;Your User Id&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Your Password&lt;/SPAN&gt;");

    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (method != HttpMethods.GET &amp;amp;&amp;amp; 
        method != HttpMethods.DELETE)
    {
        &lt;SPAN style="COLOR: #008000"&gt;// Next, based on the encoding calculate the&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #008000"&gt;// content length, type and populate the body of the request.&lt;/SPAN&gt;
        Encoding encoding = Encoding.UTF8;
        request.ContentLength = encoding.GetByteCount(data);
        request.ContentType = contentType;

        request.GetRequestStream().Write(
            encoding.GetBytes(data), 0, (&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;)request.ContentLength);
        request.GetRequestStream().Close();
    }
    &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;
    {
        &lt;SPAN style="COLOR: #008000"&gt;// If we're doing a GET or DELETE don't bother with this as all &lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #008000"&gt;// the interesting bits will be on the response.&lt;/SPAN&gt;
        request.ContentLength = 0;
    }

    &lt;SPAN style="COLOR: #008000"&gt;// Finally, return the newly created request to the caller.&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; request &lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt; HttpWebRequest;
}&lt;/PRE&gt;
&lt;H3&gt;Reading Responses&lt;/H3&gt;
&lt;P&gt;Now that we can create requests easily enough let's go ahead and create something that will read them in just as easily for us.&amp;nbsp; I'm going to make a simplifying assumption here to make this a bit easier.&amp;nbsp; I'm always just going to read in the response into a string.&amp;nbsp; Now, there are cases where you might not want to do this (say in the case of chunked responses) but this should work fine for what we want to do.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// This method can be used to read the response body from a given response.&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;param name="response"&amp;gt;The response to read.&amp;lt;/param&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #808080"&gt;/// &amp;lt;returns&amp;gt;String representation of the HTTP response.&amp;lt;/returns&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; ReadResponse(HttpWebResponse response)
{
    &lt;SPAN style="COLOR: #008000"&gt;// Begin by validating our inbound parameters.&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (response == &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;)
    {
        &lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; ArgumentNullException("&lt;SPAN style="COLOR: #8b0000"&gt;response&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Value cannot be null&lt;/SPAN&gt;");
    }

    &lt;SPAN style="COLOR: #008000"&gt;// Then, open up a reader to the response and read the contents to a string&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #008000"&gt;// and return that to the caller.&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; responseBody = String.Empty;
    &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; (Stream stm = response.GetResponseStream())
    {
        &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; (StreamReader reader = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; StreamReader(stm))
        {
            &lt;SPAN style="COLOR: #008000"&gt;// Simply read in the entire response to our string.&lt;/SPAN&gt;
            responseBody = reader.ReadToEnd();
            reader.Close();
        }
    }

    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; responseBody;
}&lt;/PRE&gt;
&lt;H3&gt;Putting it together&lt;/H3&gt;
&lt;P&gt;Okay, now that we have these simple tools in place let's try to construct something that's a bit interesting.&amp;nbsp; In this case a simple ASP.NET page which has several data bound controls (where the data comes from SSDS).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Now, I've created several containers which logically represent customers in my application (recall that a container is our partitioning unit so this data will now reside in a different partition from other customers).&amp;nbsp; Then, within each of these containers are entities of type Customer, Order and finally OrderDetail (You might recognize some of these from the Northwind DB).&lt;/P&gt;
&lt;P&gt;Now, there is only 1 customer entity within any Customer Container (and this simply contains more detailed information about that customer).&amp;nbsp; The Order and OrderDetails entities capture information about the orders that this customer currently has.&amp;nbsp; The image below illustrates what this looks like conceptually.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=322 alt=image src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_thumb.png" width=423 border=0 mce_src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;So, the first I thing I'm going to write is a bit of code which simply retrieves the total set of customers that I have.&amp;nbsp; We'll use this information to bind the customer id's to a drop down list so that we can easily select the customer whose orders we would like to view.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
{
    &lt;SPAN style="COLOR: #0000ff"&gt;const&lt;/SPAN&gt; String XmlContentType = @"&lt;SPAN style="COLOR: #8b0000"&gt;application/xml&lt;/SPAN&gt;";

    &lt;SPAN style="COLOR: #008000"&gt;// Read in authority ID from web.config.&lt;/SPAN&gt;
    String authId = WebConfigurationManager.AppSettings["&lt;SPAN style="COLOR: #8b0000"&gt;AuthId&lt;/SPAN&gt;"];

    &lt;SPAN style="COLOR: #008000"&gt;// Then, formulate our URI using the authority and the service&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #008000"&gt;// address we read in.&lt;/SPAN&gt;
    String allCustomersQuery = String.Format("&lt;SPAN style="COLOR: #8b0000"&gt;http://{0}.data.sitka.microsoft.com/v1/?q=''&lt;/SPAN&gt;",
                               			m_authId);

    &lt;SPAN style="COLOR: #008000"&gt;// Next, create the request object using the utility method we defined earlier.&lt;/SPAN&gt;
    HttpWebRequest request = CreateRequest(allCustomersQuery, HttpMethods.GET,
                                           String.Empty, XmlContentType);

    &lt;SPAN style="COLOR: #008000"&gt;// Now, attempt to read in the data.&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;(HttpWebResponse response = (HttpWebResponse) request.GetResponse())
    {
        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; responseXml = ReadResponse(response);
                        
        &lt;SPAN style="COLOR: #008000"&gt;// After reading in the response parse the response into a XDocument.&lt;/SPAN&gt;
        XDocument customerDoc = XDocument.Parse(responseXml);
        XNamespace ssdsNamespace = "&lt;SPAN style="COLOR: #8b0000"&gt;http://schemas.microsoft.com/sitka/2008/03/&lt;/SPAN&gt;";
                        
        &lt;SPAN style="COLOR: #008000"&gt;// Then, using XLinq, select all the customer containers projecting out their Id&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #008000"&gt;// to a new object which has a single property value called, "CustomerId"&lt;/SPAN&gt;
        var customerIdList =
        	from c &lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt; customerDoc.Descendants(ssdsNamespace + "&lt;SPAN style="COLOR: #8b0000"&gt;Container&lt;/SPAN&gt;")
            select &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;
            	{
                  	CustomerId = c.Element(ssdsNamespace + "&lt;SPAN style="COLOR: #8b0000"&gt;Id&lt;/SPAN&gt;").Value
                  };

         &lt;SPAN style="COLOR: #008000"&gt;// Then, bind the datasource to our drop down list.&lt;/SPAN&gt;
         &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.ddlCustomers.DataTextField = "&lt;SPAN style="COLOR: #8b0000"&gt;CustomerId&lt;/SPAN&gt;";
         &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.ddlCustomers.DataSource = customerIdList;
         &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.DataBind();
     }

}
&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;(WebException ex)
{
    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (ex.Response != &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;)
    {
        &lt;SPAN style="COLOR: #008000"&gt;// Alert the user that something happened bad happened here.  &lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #008000"&gt;// I'm just capturing the string here for debugging purposes.&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; errorMsg = ReadResponse((HttpWebResponse)ex.Response);
        
    }
}&lt;/PRE&gt;
&lt;P&gt;Before we move on you may be wondering what this actually looks like on the wire so here it is.&amp;nbsp; &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;EntitySet&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;s&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://schemas.microsoft.com/sitka/2008/03/"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;x&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;Customer000000&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;1&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;Customer000001&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;1&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;Customer000002&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;1&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;Customer000003&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
        &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;1&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Container&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- more data here but omitted...  --&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;EntitySet&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;In the prior example we operated exclusively over the containers in the service.&amp;nbsp; This time we're going to query within a particular container for Order information and project out a new class which can be used for data binding.&amp;nbsp; Now, this is only one way we could approach the problem.&amp;nbsp; Another, and one that I'll post on as well soon, would be to use XmlSerializer (or something like JAXB if you're using Java) and create a general purpose object to represent orders which we could use all over our application.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;However, in this case I'm really interested in focusing in on using XLinq with our service so I'm going to stay with the use of Anonymous classes as they are a nice for these sort of build to order classes that one sometimes needs for these kinds of DataBinding scenarios.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
{&lt;/PRE&gt;&lt;PRE&gt;      // First, read in the authority id to use from our web.config.
      String authId = WebConfigurationManager.AppSettings["&lt;SPAN style="COLOR: #8b0000"&gt;AuthId&lt;/SPAN&gt;"];&lt;/PRE&gt;&lt;PRE&gt;      const String XmlContentType = @"application/xml";

      &lt;SPAN style="COLOR: #008000"&gt;// Next, define the query that will select only those entities which have a kind value&lt;/SPAN&gt;
      &lt;SPAN style="COLOR: #008000"&gt;// of Order.&lt;/SPAN&gt;
      String query = String.Format(@"&lt;SPAN style="COLOR: #8b0000"&gt;from e in entities where e.Kind == ""Order"" select e&lt;/SPAN&gt;");

      &lt;SPAN style="COLOR: #008000"&gt;// Then, construct the URI that we'll use to make the request.  In this case, I've retrieved&lt;/SPAN&gt;
      &lt;SPAN style="COLOR: #008000"&gt;// the container id to use from a drop down list (this list was actually the one populated &lt;/SPAN&gt;
      &lt;SPAN style="COLOR: #008000"&gt;// from our last code sample).&lt;/SPAN&gt;
	String allOrdersQuery =  
          String.Format(@"&lt;SPAN style="COLOR: #8b0000"&gt;http://{0}.data.sitka.microsoft.com/v1/{1}?q='{2}'&lt;/SPAN&gt;",
                        authId, ddlCustomers.SelectedValue, query);

      HttpWebRequest request = CreateRequest(allOrdersQuery, HttpMethods.GET,
                                              String.Empty, XmlContentType);

      &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
      {
           &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; responseXml = ReadResponse(response);

           &lt;SPAN style="COLOR: #008000"&gt;// After reading in the response parse the response into a XDocument.&lt;/SPAN&gt;
           XDocument ordersDoc = XDocument.Parse(responseXml);
           XNamespace ssdsNamespace = "&lt;SPAN style="COLOR: #8b0000"&gt;http://schemas.microsoft.com/sitka/2008/03/&lt;/SPAN&gt;";

           &lt;SPAN style="COLOR: #008000"&gt;// Then, select all the customer containers projecting out their Id&lt;/SPAN&gt;
           &lt;SPAN style="COLOR: #008000"&gt;// to a new object which has a single property value called, "CustomerId"&lt;/SPAN&gt;
           var orderList =
                    from o &lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt; ordersDoc.Descendants("&lt;SPAN style="COLOR: #8b0000"&gt;Order&lt;/SPAN&gt;")
                    select &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;
                    {
                        OrderId = o.Element(ssdsNamespace + "&lt;SPAN style="COLOR: #8b0000"&gt;Id&lt;/SPAN&gt;").Value,
                        DateOrdered = Convert.ToDateTime(o.Element("&lt;SPAN style="COLOR: #8b0000"&gt;OrderDate&lt;/SPAN&gt;").Value),
                        Total = Convert.ToDecimal(o.Element("&lt;SPAN style="COLOR: #8b0000"&gt;Total&lt;/SPAN&gt;").Value)
                    };

            &lt;SPAN style="COLOR: #008000"&gt;// Then, bind the grid to the dataset values.&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.grdDataBinding.DataSource = orderList;
            &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.grdDataBinding.DataBind();
            }

       }
}
&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (WebException ex)
{
    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ex.Response != &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;)
    {
        &lt;SPAN style="COLOR: #008000"&gt;// Read in the error message and alert the user.&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #008000"&gt;// For now, I'm just keeping this here for debugging purposes.&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; errorMsg = ReadResponse((HttpWebResponse) ex.Response);
    }
}&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;In this last code example we've constructed a query over a specific container.&amp;nbsp; This query places a restriction over the output such that only entities that match the Kind predicate that we've setup are returned to us.&amp;nbsp; Listed below is an example of what this looks like on the wire.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;EntitySet&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;s&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://schemas.microsoft.com/sitka/2008/03/"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;x&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
   &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;2001-11-02T01:01:01Z-O044501&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;5&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HighPriority&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:boolean"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;true&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HighPriority&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderId&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:string"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;O044501&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderId&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderDate&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:dateTime"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;2001-11-02T01:01:01 &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderDate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Total&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:decimal"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;26128.8674&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Total&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
   &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
   &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;2002-02-02T01:01:01Z-O045283&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;5&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HighPriority&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:boolean"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;true&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HighPriority&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderId&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:string"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;O045283&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderId&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderDate&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:dateTime"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;2002-02-02T01:01:01&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderDate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Total&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:decimal"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;37643.1378&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Total&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
   &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
   &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;2002-05-02T01:01:01Z-O046042&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;5&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HighPriority&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:boolean"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;true&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HighPriority&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderId&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:string"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;O046042&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderId&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderDate&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:dateTime"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;2002-05-02T01:01:01&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;OrderDate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
       &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Total&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"x:decimal"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;34722.9906&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Total&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
    &lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- Omitting other orders for simplicity. --&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;s&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;EntitySet&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Now, we have a very simple data bound ASP.NET application which shows you can do data binding very simply using SSDS.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=346 alt=image src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_thumb_1.png" width=693 border=0 mce_src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SomeSQLServerDataServicesCodingExamples_9393/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;--Jeff--&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8292420" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/MIX08/default.aspx">MIX08</category></item><item><title>What I've been working - SSDS (SQL Server Data Services)</title><link>http://blogs.msdn.com/jcurrier/archive/2008/03/07/what-i-ve-been-working-ssds-sql-server-data-services.aspx</link><pubDate>Sat, 08 Mar 2008 03:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8108479</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8108479.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8108479</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8108479</wfw:comment><description>&lt;P&gt;I'm writing this from Gate D26 at the Las Vegas airport waiting to catch a flight back to Seattle.&amp;nbsp; It's been a crazy week here at MIX but an exciting one!&amp;nbsp; The project I've been working on, &lt;A class="" href="http://www.microsoft.com/sql/dataservices/default.mspx" mce_href="http://www.microsoft.com/sql/dataservices/default.mspx"&gt;SQL Server Data Services,&lt;/A&gt; was announced this week as a beta and everyone on the team has really been working full tilt to try to get the service out there for everyone to use.&amp;nbsp; As a dev this is that time&amp;nbsp;you always enjoy the&amp;nbsp;most.&amp;nbsp; Getting something shipped (even if it is for beta)&amp;nbsp;and then getting others to use it.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It's been a wild, but fun, ride thus far and I know that I, as well the entire team, are really looking forward to feedback from the community on our service and on how they plan to use it.&amp;nbsp; So, please do share your thoughts on any of the material that you've seen posted.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In addition to the talks that we gave at MIX (which I've listed below) we will be posting the hands on lab materials that we created for MIX to our site so that even if you didn't get the chance to make it to Vegas you can still get some experience with the service.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;MIX Talks&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://visitmix.com/blogs/2008Sessions/BT05/" mce_href="http://visitmix.com/blogs/2008Sessions/BT05/"&gt;Nigel's intro/overview of SSDS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.visitmix.com/blogs/OpenSpace/Jason-Hunter-and-Jeff-Currier-on-SQL-Server-Data-Services/" mce_href="http://www.visitmix.com/blogs/OpenSpace/Jason-Hunter-and-Jeff-Currier-on-SQL-Server-Data-Services/"&gt;My talk (along with Jason Hunter) on patterns that one can use while developing with SQL Server Data Services&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.visitmix.com/blogs/OpenSpace/Istvan-Cseri-on-SQL-Server-Data-Services/" mce_href="http://www.visitmix.com/blogs/OpenSpace/Istvan-Cseri-on-SQL-Server-Data-Services/"&gt;Isvtan's whiteboard discussion of SQL Server Data Services&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here's some other resources to keep an eye relative to SQL Server Data Services:&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/ssds/" mce_href="http://blogs.msdn.com/ssds/"&gt;Our team blog (The long term store cast).&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://channel9.msdn.com/showpost.aspx?postid=388698" mce_href="http://channel9.msdn.com/showpost.aspx?postid=388698"&gt;Dave's interview on Channel9&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In the mean time please do share (with what information you have) what your thoughts are on the service.&amp;nbsp; I would (as would the rest of the team) love to hear the feedback on things like the API surface area, protocols that are important to you, etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Til Next Time!&lt;/P&gt;
&lt;P&gt;--Jeff--&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8108479" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/MIX08/default.aspx">MIX08</category></item></channel></rss>