try
{
//打开连接
conn.Open();
//为命令对象附加连接
command.Connection = conn;
//获取Data Reader
OleDbDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
//获取reader中的记录数
int count = 0;
while (reader.Read())
{
count++;
}
//创建数组并赋值
string[] myString = new string[count];
for (int i = 0; i < count; i++)
{
myString[i] = reader.GetValue(i).ToString();
}
}
finally
{
conn.Close();
}
ORACLE获取oledbdatareader 记录数
最新推荐文章于 2021-04-13 07:43:23 发布