How to find the count of records in a dataset?

Answers were Sorted based on User's Feedback



How to find the count of records in a dataset?..

Answer / jeyaram thangaponnan

DataSet.Tables[0].Rows.Count will give the number of rows
in that table

Is This Answer Correct ?    30 Yes 0 No

How to find the count of records in a dataset?..

Answer / vaidyanathan r.

int count = 0
foreach(DataTable CurrTable in DataSet1.Tables)
Count += currTable.Rows.Count;

Is This Answer Correct ?    9 Yes 1 No

How to find the count of records in a dataset?..

Answer / eduardo belmonte

Regarding answer # 3 : It is correct.

Regarding answer # 2 : It is not correct, remember a
dataset contains datatables, and those datatables each can
have its own amount of datarows.

So to know "all" datarows in a dataset you have to add how
many rows "each" of its component datatables may have.

Is This Answer Correct ?    6 Yes 0 No

How to find the count of records in a dataset?..

Answer / jagadish

DS.Tables["tabname"].Rows.Count;

we can get count of the records.

Is This Answer Correct ?    6 Yes 2 No

How to find the count of records in a dataset?..

Answer / pushpendra singh

DataSet.Tables[0].rows.count returns total rows in table.

Is This Answer Correct ?    4 Yes 1 No

How to find the count of records in a dataset?..

Answer / guest

foreach(DataTable thisTable in myDataSet.Tables){
// For each row, print the values of each column.
foreach(DataRow myRow in thisTable.Rows)}

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More ADO.NET Interview Questions

If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcommand.executereader (commandbehaviour.singleresult)or sqlcommand.executescalar()

4 Answers  


what is a dataview?why is it used for?

4 Answers   Choice Solutions,


What are the two fundamental objects in ADO.NET?

8 Answers   Ksb, TCS,


What is the difference between connected environment and a disconnected environment?

2 Answers  


Sequence to connect and retrieve data from database useig dataset ?

6 Answers   MMTS,






What are all components of ADO.Net data provider?

0 Answers  


How do we invoke queries from the application ?

2 Answers   ICICI, Microsoft,


How to add an aggregate column?

0 Answers  


What is adodb dll?

0 Answers  


what is type dataset?

3 Answers  


once data is fetched into dataset connection gets closed. but in datareader connection is always maintained...then why datareader is fast and mainly recommended ?

2 Answers  


describe the dataset object in ado.net.

0 Answers  


Categories