how can i check if my dataset is empty?

yaniv

Well-known member
Joined
Apr 15, 2002
Messages
162
Location
israel
MY dataset is built on a query that can return no values at all.
can i check if it is empty before i"m starting to suck the data?
 
You can check the DataTables Rows.Length (or is it Count?) property. Assume you have a table in your dataset named "Table1":
C#:
if(ds.Tables["Table1"].Rows.Length > 0)
{
    // You have data
}
else
{
    // You have no data
}

-Nerseus
 
Back
Top