how to get number of rows returned by a SqlDataReader?

  • Thread starter Thread starter Juan
  • Start date Start date
Juan,
I don't think you can. If you want that type of information you'll have
to use a DataSet instead. The performance of a SqlDataReader is better, but
if you need that type of information before you loop through the results, I
think you'll have to use a DataSet.

HTH
 
Thanks, needed a confirmation...

Lateralus said:
Juan,
I don't think you can. If you want that type of information you'll have
to use a DataSet instead. The performance of a SqlDataReader is better, but
if you need that type of information before you loop through the results, I
think you'll have to use a DataSet.

HTH

--
Lateralus [MCAD]


Juan said:
how to get number of rows returned by a SqlDataReader without having to
scroll it?
 
Well, even the recordset doesn't know how many rows it
has in it until it reads the entire set, you just get a '-
1' returned until you go to the end of the dataset
forcing the entire dataset to be read.
 
Back
Top