HasTables
Determina si un DataSet tiene DataTables con Datos.
Source
public static bool HasTables(this DataSet source) {
bool lResult = false;
if(source != null && source.Tables.Count > 0) {
foreach(DataTable lDtTabla in source.Tables) {
lResult = (lDtTabla != null && lDtTabla.Rows.Count > 0);
if(lResultado) break;
}
}
return lResult;
}
Example
DataSet DtSet = new DataSet();
if(DtSet.HasTables()){
//your code...
}