Executing a Stored Procedure using SQL Azure
using Sytem.Data;
using System.Data.SqlClient;
protected void Page_Load(object sender, EventArgs e)
{
//stoaxy9 - unique server that is generated automatically for your account. Make trusted connection to false.
string sConn = "Server=tcp:stoaxy9.database.windows.net;
Database=TestDB;User ID=dons;
Password=mypassword;Trusted_Connection=False";
SqlConnection objConn = new SqlConnection(sConn);
objConn.Open();
SqlCommand objCmd = new SqlCommand("dbo.GetNames", objConn);
objCmd.CommandType = System.Data.CommandType.StoredProcedure;
myGridView.DataSource = objCmd.ExecuteReader();
myGridView.DataBind();
objConn.Close();
}