Created
July 13, 2009 19:49
-
-
Save steefjan/146390 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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