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 |
If a table contains 20000 records . In a page at each time 100 records to be displayed what are the steps you will take to improve performance? Will you use dataset or datareader?
Which is faster ado.net or linq?
Difference between datareader and dataset?
26 Answers Microsoft, Noel Infotech, Satyam, Value Labs,
How to sort the data in Datatable
What is fill method in ado.net?
Define data access layer?
How can you implement sub data grid in a master datagrid?
What provider ADO.net use by default?
Define different execute methods of ADO.NET command object ?
How can I retrieve two tables of data at a time by using data reader? Data reader read and forward only, how is it possible to get 2 tables of data at a time?
How xml files and be read and write using dataset ?
What is method to get XML and schema from Dataset?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)