// đầu vào là tên của một proceduce
{
DataTable tbl
= new DataTable
(); SqlCommand cmd
= new SqlCommand
();
cmd.CommandText = ProcName;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = m_con.sqlCon;// ở đây bạn có thể sửa lại thành connection của mình.
{
SqlDataAdapter adap
= new SqlDataAdapter
(cmd
); adap.Fill(tbl);
}
{
strError = e.Message;
}
}
// đầu vào là tên của proceduce, tên các tham số, giá trị các tham số.
{
DataTable tblResult
= new DataTable
(); SqlDataAdapter dap;
{
SqlCommand cmd
= new SqlCommand
(); cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = ProcName;
cmd.Connection = con.sqlCon; // ở đây bạn có thể sửa lại thành connection của mình.
while (i
< ArrParamaterName
.Length) {
cmd.Parameters.AddWithValue(ArrParamaterName[i], ArrParamaterValue[i]);
i++;
}
dap
= new SqlDataAdapter
(cmd
); dap.Fill(tblResult);
}
{
strError = e.Message;
}
}