读取OleDbDataReader对象的方法

读取OleDbDataReader对象的方法:
假设oleDbRead为OleDbDataReader对象
1.根据索引
if (oleDbRead.Read())
{
      string str = oleDbRead.GetString(0);
      int i = oleDbRead.GetInt32(1);
}
oleDbRead.close();
2.根据字段名称
if (oleDbRead.Read())
{
      string str = oleDbRead["str"].ToString();
      int i = Convert.ToInt32(oleDbRead[i].ToString());
}
oleDbRead.close();

SqlDataReader对象读取方法类似。
原文地址:https://www.cnblogs.com/aDust/p/1558647.html