row count of DataTable object

  • Thread starter Thread starter Will C
  • Start date Start date
W

Will C

Is there any way to retrieve rowcount in Datatable object
without iterating through DataRow collection and using
your own counter? Thanks in advance for your help.
 
Why you need iterate through DataRow? Is it available: DataTable.Rows.Count?
 
Hi,

DataTable has a Rows property, this is a DataRowCollection which has a count
property. So if your DataTable instance was 'dt' the following should do the
trick.

dt.Rows.Count

Hope this helps

Chris Taylor
 

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