A DataReader reads data as your code proceeds in the reading loop. Because
of this, you can't know how much rows are returned until they are all
processed.
If you don't need the number of rows before reading them :
- count the rows in the reading loop
If you need this number before reading the rows
- issue a separate select count(*) statement to return the number of rows
(The ado.net group should be enough)
-
"anand" <an****@armour.com> a écrit dans le message de
news:uW**************@tk2msftngp13.phx.gbl...
Hello Group,
How can i obtain the total no of records selected with the help of
Datareader class. rowsaffected does not seem to work.
Thanks
Anand