How to find the count of records in a dataset?
Answers were Sorted based on User's Feedback
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 |
Answer / vaidyanathan r.
int count = 0
foreach(DataTable CurrTable in DataSet1.Tables)
Count += currTable.Rows.Count;
Is This Answer Correct ? | 9 Yes | 1 No |
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 |
Answer / jagadish
DS.Tables["tabname"].Rows.Count;
we can get count of the records.
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / pushpendra singh
DataSet.Tables[0].rows.count returns total rows in table.
Is This Answer Correct ? | 4 Yes | 1 No |
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 |
Explain the role of data provider in ado.net? What is the role of data provider in ado.net?
What is the difference between an ADO.NET Dataset and an ADO Recordset?
What are the classes in System.Data.Common Namespace?
What is the difference between a Dataset and DataReader? Can dataReader hold data from multiple tables?
3 Answers Fulcrum Logic, Merrill Lynch,
What does datareader object do?
What is serialization and de-serialization in .net?
What are the major difference between classic ADO and ADO.NET?
What are the advantages of ado.net?
types of Store procedure in Sqlserver2000?
Define connection string?
What is ado.net components?
Which is the best institute in navi mumbai to learn DotNet