Skip to content

Instantly share code, notes, and snippets.

@steefjan
Created July 13, 2009 19:49
Show Gist options
  • Save steefjan/146390 to your computer and use it in GitHub Desktop.
Save steefjan/146390 to your computer and use it in GitHub Desktop.
private void buttonTest_Click(object sender, EventArgs e)
{
//////////////////////////////////////////////////////////////////////
// CREATING THE CLIENT
///////////////////////////////////////////////////////////////////////
Procedures_dboClient client = new Procedures_dboClient("SqlAdapterBinding_Procedures_dbo");
//Windows Authentication
///////////////////////////////////////////////////////////////////////
// OPENING THE CLIENT
///////////////////////////////////////////////////////////////////////
try
{
Console.WriteLine("Opening Client...");
client.Open();
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
throw;
}
///////////////////////////////////////////////////////////////////////
// EXECUTING THE GET_EMP_DETAILS STORED PROCEDURE
///////////////////////////////////////////////////////////////////////
DataSet[] dataArray;
int returnCode;
try
{
Console.WriteLine("Calling a stored procedure...");
dataArray = client.uspGetEmployeeDetail(textBoxNationalIDNumber.Text, out returnCode);
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
throw;
}
Console.WriteLine("The details for the employee with NationalIDNumber are: {0}", textBoxNationalIDNumber.Text);
Console.WriteLine("*************************************************");
textBoxResult.Text = dataArray[0].Any1.FirstChild.InnerXml;
/////////////////////////////////////////////////////////////////////////
// CLOSING THE CLIENT
/////////////////////////////////////////////////////////////////////////
client.Close();
Console.WriteLine("Press any key to exit...");
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment