Build Big-Data Apps: Listing 1.
Connecting to the Federation Root Database
/ Create a Connection to the Federation Root
SqlGuid fedKeyValue = customerId;
SqlConnection connection =
new SqlConnection(@"Server=tcp:sqlAzureURI;
Database=SalesDB;User ID=mylogin@myserver;
Password=mypassword")
connection.Open();
// Route to the Specific Customer's Atomic Units
SqlCommand command = connection.CreateCommand())
command.CommandText =
"USE FEDERATION Orders_Federation(" +
fedKeyValue.ToString() + ") WITH RESET";
command.ExecuteNonQuery();