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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top