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.
 
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
 
Back
Top