DataSet data = new DataSet; if (data.Tables.Count > 0 && data.Tables[0].Rows.Count>0) { //有数据 } else { //无数据 }