numbers of rows

  • Thread starter Thread starter Claudia Fong
  • Start date Start date
C

Claudia Fong

Hi,

I'm using a DataReader to connect to a db and retrieve data from the db.
I just wondering how can I know the numbers of rows contain in my DB for
the sql statement I used? For example, if the sql statement is like
this:

SELECT *
FROM DEPT;

I try objReader.(but I didn't find any reserved word related to
Rows.Count...


Can someone help me with this?

Cheers!

Claudi
 
Datareader is connected forward only "recordset". There's no way of knowing
how many records there are without going through all the records and
actually counting them.
You can use DataSet Tables if you need rows count: DataTable.Rows.Count.
 
Back
Top