here is an example:
// Create and Open the SQL server connection object
using (SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=HedgeFund_PRD;Inte
grated Security=SSPI;"))
con.Open();
//// Create a command object and specify the Stored Procedure name and connection as well
SqlCommand cmd = new SqlCommand("exec dbo.spTest 1, 1, '1960-01-01', '2013-12-31'", con);
// Set the command object
cmd.CommandType = CommandType.Text;
// Execute the command
using (SqlDataReader rd = cmd.ExecuteReader())
int count = 0;
while (rd.Read())
count++;
MessageBox.Show(string.For
mat("There
are {0} rows.", count));
catch (Exception e)
MessageBox.Show(e.Message)
;