|
/**
* 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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.