1   if (ds.Tables[0].Rows[0]["NullField"] == DBNull.Value)   

2  if (ds.Tables[0].Rows[i]["NullField"] is DBNull)

3.isdbnull(ds.tb.row(xx).item(xx))  return Bool

4.Convert.IsDBNull()

三种常用的字符串判空串方法:
  • Length法:bool isEmpty = (str.Length == 0);
  • Empty法:bool isEmpty = (str == String.Empty);
  • General法:bool isEmpty = (str == "");
posted on 2007-04-17 17:05  小姜  阅读(620)  评论(0编辑  收藏  举报