|
ActiveDB
|
Click Here
|
DataSet ds = Northwind.Employee_Sales_by_Country(from, thru);
|
SqlConnection conn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter adapter = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlParameter param;
conn.ConnectionString = "Data Source=(local);" +
"Initial Catalog=Northwind;Integrated Security=true;";
cmd.CommandText = "Employee Sales by Country";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = conn;
param = new SqlParameter();
param.Direction = ParameterDirection.ReturnValue;
param.SqlDbType = SqlDbType.Int;
cmd.Parameters.Add(param);
param = new SqlParameter();
param.ParameterName = "@Beginning_Date";
param.Direction = ParameterDirection.Input;
param.SqlDbType = SqlDbType.DateTime;
param.Value = from;
cmd.Parameters.Add(param);
param = new SqlParameter();
param.ParameterName = "@Ending_Date";
param.Direction = ParameterDirection.Input;
param.SqlDbType = SqlDbType.DateTime;
param.Value = thru;
cmd.Parameters.Add(param);
cmd.Connection.Open();
adapter.SelectCommand = cmd;
adapter.Fill(ds);
int rc = (int) cmd.Parameters[0].Value;
adapter.Dispose();
cmd.Connection.Dispose();
cmd.Dispose();
|
|