4
Answers

Datareader's row count?

yokzu

yokzu

14y
39k
1
hello
I have a datareader and I how can i know that, how many row this datareader have?


string query_ci = "SELECT [Kolon1],[Kolon2],[Kolon3] FROM[Sheet6$A:J] WHERE [Kolon1]='" + kolon_bul+ "'";
OleDbDataReader rdr_ci;
OleDbCommand komut_ci = new OleDbCommand(query_ci, conn);
rdr_ci = komut_ci.ExecuteReader();
     ---> i want to know in here rows this "rdr_ci" have?
while (rdr_ci.Read())         
{
       ---> or in here, i want to know in here how many times this "while" count in the first loop?

OleDbCommand komut = new OleDbCommand("UPDATE [Sheet6$] SET [Cat]='OK' WHERE [Sira]='" + rdr_ci["Sira"] + "'  ", baglanti);
komut.ExecuteNonQuery();
}
Answers (4)