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

How to you declare connection strings and how to you make use of web.config ?

3 Answers   MMTS,


What is ado.net components?

0 Answers  


Explain the ADO . Net Architecture ( .Net Data Provider) ?

2 Answers  


What are dataproviders?

0 Answers  


What are the namespaces used in ADO.Net to connect to a database?

0 Answers  


What is oledb driver?

0 Answers  


Which type of database is used while processing dynamic database?

1 Answers   Microsoft,


What is command class in ado.net?

0 Answers  


What is a datatable?

8 Answers   State Bank Of India SBI,


What is csdl entity framework?

0 Answers  


Explain how to pass multiple tables in datasets simultaneously?

0 Answers  


What are the Different layers in ADO.Net?

10 Answers   eXensys,


Categories