Home > Interview Questions > ADO.NET > How to check, whether dataset has records or not?

How to check, whether dataset has records or not?

by Spidy   on 18/05/2011   Category: ADO.NET   |  Level: Beginner   |  Views: 1515    |  Points: 25     |  Silver 


By using rows count.

 if (ds.Tables[0].Rows.Count > 0)
{
//Has records
}
else
{
//No records
}



« What is the use of DataAdapter.Fill() in ADO.NET?
» Does Repeater control have capable to edit the data?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts