导航

判断DataTable是否为空

Posted on 2016-11-01 13:26  yiyishuitian  阅读(1344)  评论(0编辑  收藏  举报

 

DataTable:

if(DataTable== null || DataTable.Rows.Count == 0 )

{

  //为空的操作

}

 

DataRow:


if(!DataRow.IsNull("列名"))

{

  //不为空的操作

}