DbColumn.AllowDBNull 属性


获取可为 null 的布尔值,该值指示此列中是否允许 DBNull 值,或者在未设置任何值时返回 nullGets a nullable boolean value that indicates whether DBNull values are allowed in this column, or returns null if no value is set. 在派生类中重写时,可设置为 truefalse,指示此列中是否允许 DBNull 值,也可设置为 null(在 Visual Basic 中为 Nothing)。Can be set to either true or false indicating whether DBNull values are allowed in this column, or null (Nothing in Visual Basic) when overridden in a derived class.

public:  property Nullable<bool> AllowDBNull {  public:
Nullable<bool> get(); protected:
 void set(Nullable<bool> value); };
public bool? AllowDBNull { get; protected set; }
member this.AllowDBNull : Nullable<bool> with get, set
Public Property AllowDBNull As Nullable(Of Boolean)



如果此列中允许 DBNull 值,则返回 true,否则,返回 falseReturns true if DBNull values are allowed in this column; otherwise, false. 如果未设置任何值,则返回空引用(在 Visual Basic 中为 Nothing)。If no value is set, returns a null reference (Nothing in Visual Basic).