2个回答
展开全部
using(SqlConnection con = new SqlConnection("连接字符串")){
using(SqlDataAdapter adapter = new SqlDataAdapter("查询字符串", con)){
DataTable result = new DataTable();
adapter.Fill(result);
gridview.DataSource = result;
gridview.DataBind();
}
}
using(SqlDataAdapter adapter = new SqlDataAdapter("查询字符串", con)){
DataTable result = new DataTable();
adapter.Fill(result);
gridview.DataSource = result;
gridview.DataBind();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询