Better to check for all these
if(ds != null)
if(ds.Tables.Count > 0 )
if(ds.Tables[0].Rows.Count > 0)
Or you can create a generic function to see if your dataset is Empty like
bool IsEmpty(DataSet dataSet)
{
return !dataSet.Tables.Cast<DataTable>().Any(x => x.DefaultView.Count > 0);
}
also The Fill() method of DataAdapter returns the # of rows added for the first table in the DataSet.