//C#检测DataSet是否为空的方法 
     DataSet ds = new DataSet();
            if (dt.Tables.Count > 0) 
            {
                //有数据
            }
            else((ds.Tables.Count==1&&ds.Tables[0].Rows.Count==0)||ds==null||ds.Tables.Count==0)
            {
               //无数据
            }
   // C#检测DataTable是否为空的方法 
            DataTable dt = new DataTable();
            if (dt.Rows.Count > 0)
            {
                //不为空的操作
            }
            else (dt == null || dt.Rows.Count == 0)
            {
                //为空操作
            }

 

相关文章:

  • 2021-12-13
  • 2022-12-23
  • 2021-09-07
  • 2021-10-26
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-09-28
  • 2021-09-12
  • 2022-03-05
相关资源
相似解决方案