作业帮 > 综合 > 作业

C#OleDbDataReader thisReader =thisCommand.ExecuteReader()这是啥

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/18 00:09:01
C#OleDbDataReader thisReader =thisCommand.ExecuteReader()这是啥意思〉?
求具体点的注释.写了
这条语句的意思是,执行thisCommand对象中的sql查询命令,并返回查询结果,并将查询结果保存到thisReader 对象中,
 你可以通过下面代码读取查询的结果:while (thisReader.Read())
        {
            //thisReader[0]  表示表中的第一列数据,[1] 表示第二列数据,依次类推
           Console.WriteLine(thisReader[0].ToString());
        }
thisReader.Close();