Interviews2 answers
How to check if the Dataset has records ?
2 Answers
DataSet ds// ... instantiate DataSet
bool hasRows = ds.Tables.Cast().Any(table => table.Rows.Count != 0);
This will return true if there are any rows in any of the tables. It will return false if there are no tables or no rows.
Ravi PatelPosted Jan 3, 2016, 7:07 PM EST
if ds.Tables(0).Rows.Count= 0 then
'No record
else
'record found
Samir BhogaytaPosted Sep 3, 2015, 4:07 AM EDT


