Click here to Skip to main content
15,891,136 members
Articles / Programming Languages / SQL

A Cloudy Approach – SQL Data Services

Rate me:
Please Sign up or sign in to vote.
4.54/5 (7 votes)
9 Nov 2008CPOL6 min read 41.9K   284   39  
Overview of Microsoft's cloud platform
/**
 * Microsoft Student Program - Demo Source
 * 
 * This demo shows how to connect via SOAP to 
 * a SQL Server Data Service and make some query.
 * 
 * 10/18/2008 - [MSP] Denis Dwornitzak
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MSP_SSDS_Demo.SSDSClient;

namespace MSP_SSDS_Demo
{
    class Program
    {
        // Please enter your credentials right here
        static string _UserName = "";
        static string _Password = "";

        static void Main(string[] args)
        {
            using (SitkaSoapServiceClient proxy = new SitkaSoapServiceClient("SitkaSoapEndpoint"))
            {
                // Access to SSDS
                proxy.ClientCredentials.UserName.UserName = _UserName;
                proxy.ClientCredentials.UserName.Password = _Password;
                
                // Definition of the scope
                Scope myContainerScope = new Scope();
                myContainerScope.AuthorityId = "msp-goes-ssds";
                myContainerScope.ContainerId = "actiongames";

                // Sample Query
                string sampleQuery = @"from e in entities where e.Id > ""1"" select e";

                // Process Query
                IEnumerable<Entity> games = proxy.Query(myContainerScope, sampleQuery);

                // List response
                foreach (Entity e in games)
                    Console.WriteLine(e.Properties["Name"]);

                Console.Write("Press any key...");
                Console.ReadKey(true);
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems Engineer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions