SqlDataReader有Reader和GetValue()方法,前者是提取一行,后者是取行中某一列的值!

eg:

SqlDataReader rdr=cmd.ExecuteReader();

//

Table Northwind.Employees:

While(rdr.Read())

{

 Console.WriteLine("Employee name:{0}{1}",rdr.GetValue(0),rdr.GetValue(1));

}

相关文章:

  • 2021-07-10
  • 2021-09-21
  • 2021-07-06
  • 2021-12-13
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2021-08-18
  • 2022-02-18
  • 2022-03-02
  • 2021-12-24
相关资源
相似解决方案