public partial class 列循环 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string constr = "data source=PC-20120604KNHD;initial catalog=Schools;user id=sa;password=910809";
using (SqlConnection con = new SqlConnection(constr))
{
string sql = "select * from T_Student;select * from TblClass";
using (SqlCommand cmd = new SqlCommand(sql, con))
{
con.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
if (reader.HasRows)
{
#region//读取一个结果集
while (reader.Read())
{
从数据库中查询一个结果集和多个结果集的方法
最新推荐文章于 2021-12-22 17:55:06 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)