📜  c# 存储过程的结果集 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:50.642000             🧑  作者: Mango

代码示例1
SqlConnection connection = new SqlConnection(ConnectionString);

 command = new SqlCommand("TestProcedure", connection);
 command.CommandType = System.Data.CommandType.StoredProcedure;

 connection.Open();

 DataTable dt = new DataTable();

 dt.Load(command.ExecuteReader());

 gvGrid.DataSource = dt;
 gvGrid.DataBind();