isnull是SQL语句中到不,select isnull(name,'无') as 姓名 from……,在System.Data中,可以用
if(row[0]==DBNull.Value)
{
}来判断某一个字段是否为空。

解决方案 »

  1.   

    sql语言ISNULL  允许选择列没有值的行,如果使用NOT NULL则情况相反,例如:...WHERE region IS NULL  返回region没有值的所有行.
           ..  WHERE region IS NOT NULL 返回region含有值的所有行.
      

  2.   

    下面的 DBBool 结构实现了一个三值逻辑类型。该类型的可能值有 DBBool.True、DBBool.False 和 DBBool.Null,其中 Null 成员指示未知值。这样的三值逻辑类型经常用在数据库中。public struct DBBool
    {
       // The three possible DBBool values.
       public static readonly DBBool Null = new DBBool(0);
       public static readonly DBBool False = new DBBool(-1);
       public static readonly DBBool True = new DBBool(1);
       // Private field that stores –1, 0, 1 for False, Null, True.
       sbyte value;
       // Private instance constructor. The value parameter must be –1, 0, or 1.
       DBBool(int value) {
          this.value = (sbyte)value;
       }
       // Properties to examine the value of a DBBool. Return true if this
       // DBBool has the given value, false otherwise.
       public bool IsNull { get { return value == 0; } }
       public bool IsFalse { get { return value < 0; } }
       public bool IsTrue { get { return value > 0; } }
       // Implicit conversion from bool to DBBool. Maps true to DBBool.True and
       // false to DBBool.False.
       public static implicit operator DBBool(bool x) {
          return x? True: False;
       }
       // Explicit conversion from DBBool to bool. Throws an exception if the
       // given DBBool is Null, otherwise returns true or false.
       public static explicit operator bool(DBBool x) {
          if (x.value == 0) throw new InvalidOperationException();
          return x.value > 0;
       }
       // Equality operator. Returns Null if either operand is Null, otherwise
       // returns True or False.
       public static DBBool operator ==(DBBool x, DBBool y) {
          if (x.value == 0 || y.value == 0) return Null;
          return x.value == y.value? True: False;
       }
       // Inequality operator. Returns Null if either operand is Null, otherwise
       // returns True or False.
       public static DBBool operator !=(DBBool x, DBBool y) {
          if (x.value == 0 || y.value == 0) return Null;
          return x.value != y.value? True: False;
       }
       // Logical negation operator. Returns True if the operand is False, Null
       // if the operand is Null, or False if the operand is True.
       public static DBBool operator !(DBBool x) {
          return new DBBool(-x.value);
       }
       // Logical AND operator. Returns False if either operand is False,
       // otherwise Null if either operand is Null, otherwise True.
       public static DBBool operator &(DBBool x, DBBool y) {
          return new DBBool(x.value < y.value? x.value: y.value);
       }
       // Logical OR operator. Returns True if either operand is True, otherwise
       // Null if either operand is Null, otherwise False.
       public static DBBool operator |(DBBool x, DBBool y) {
          return new DBBool(x.value > y.value? x.value: y.value);
       }
       // Definitely true operator. Returns true if the operand is True, false
       // otherwise.
       public static bool operator true(DBBool x) {
          return x.value > 0;
       }
       // Definitely false operator. Returns true if the operand is False, false
       // otherwise.
       public static bool operator false(DBBool x) {
          return x.value < 0;
       }
       public override bool Equals(object o) {
          try {
             return (bool) (this == (DBBool) o);
          }
          catch {
             return false;
          }
       }
       public override int GetHashCode() {
          return value;
       }
       public override string ToString() {
          switch (value) {
             case -1:
                return "DBBool.False";
             case 0:
                return "DBBool.Null";
             case 1:
                return "DBBool.True";
             default:
                throw new InvalidOperationException();
          }
       }}
      

  3.   

    在C#中也有ISNULL这个方法呀,看帮助都能找到,但上面没有说是哪个命名空间??
      

  4.   

    如果你说的是Data.ISNULL就在System.Data命名空间里
      

  5.   

    不用一定要用isNULl
    你自己用==null就可以了。
      

  6.   

    C#中有IsNull,可以是函数,方法,属性。