DataSet是否为空 - IsEmpty
2017-02-26 15:56:47 访问(1863) 赞(0) 踩(0)
/// <summary>
/// DataSet是否为空 - IsEmpty
/// </summary>
/// <param name="ds"></param>
/// <returns></returns>
public static bool IsEmpty(DataSet ds)
{
if (ds == null)
return true;
if (ds.Tables.Count == 0)
return true;
if (ds.Tables[0].Rows.Count == 0)
return true;
return false;
}
/// <summary>
/// DataSet是否非空 - IsNotEmpty
/// </summary>
/// <param name="ds"></param>
/// <returns></returns>
public static bool IsNotEmpty(DataSet ds)
{
return !IsEmpty(ds);
}
标签:
DataSet是否为空 - IsEmpty 


上一条:
下一条:
相关评论
发表评论