number of recs from select

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

Hi all,

I am trying to figure out how to retrieve the number of
records resulting from a select. I tried executereader
but the object does not contain the number iof records retrieved. Any
suggestions?

Thanks,

Carlos
 
use executescalar with "select count(*) from yourtable"

or

loop through all of the records in the reader and increment a counter.
 
¤ Hi all,
¤
¤ I am trying to figure out how to retrieve the number of
¤ records resulting from a select. I tried executereader
¤ but the object does not contain the number iof records retrieved. Any
¤ suggestions?

If you're pulling the rows into DataSet you can check the Count property of the Rows collection of
the DataTable.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top