Check dataset is empty or not
In my opinion the 'right' way is to check both:
ds2.Tables.Count
ds2.Tables[0].Rows.Count
I'd try check for:ds2.HasChanges()
It should be true if any data has been added.
For further information check here.
You can use bool
and return true
. For all tables in dataset
bool IsEmpty(DataSet dataSet)
{
foreach(DataTable table in dataSet.Tables)
if (table.Rows.Count != 0) return false;
return true;
}