Question : How to count OLEDB DataReader

Hi Experts

I have a OleDB Datareader wich I use to read trough records from a given query. But but Now I need to create a for loop, and the I need the amount af rows in the data reader. Does anybody know how I can get the amount of rows from a data reader?

Any help would be greatly appreciated

Thanx in advance

Answer : How to count OLEDB DataReader

If you just want to know the total of records you should use a different SQL statement and a ExecuteScalar method.


Something like:


"SELECT Count(id) AS total FROM myTable"

Random Solutions  
 
programming4us programming4us