OdbcParameter.IsNullable 属性

定义

获取或设置一个值,该值指示参数是否接受 null 值。

public:
 virtual property bool IsNullable { bool get(); void set(bool value); };
public:
 property bool IsNullable { bool get(); void set(bool value); };
public override bool IsNullable { get; set; }
[System.ComponentModel.Browsable(false)]
public bool IsNullable { get; set; }
member this.IsNullable : bool with get, set
[<System.ComponentModel.Browsable(false)>]
member this.IsNullable : bool with get, set
Public Overrides Property IsNullable As Boolean
Public Property IsNullable As Boolean

属性值

如果接受 null 值,则为 true;否则为 false。 默认值为 false

属性

示例

以下示例创建 并 OdbcParameter 设置其一些属性。

Public Sub CreateOdbcParameter()  
   Dim parameter As New OdbcParameter("Description", OdbcType.VarChar, 88)  
   parameter.IsNullable = True  
   parameter.Direction = ParameterDirection.Output  
End Sub  
public void CreateOdbcParameter()   
{  
   OdbcParameter parameter = new OdbcParameter("Description", OdbcType.VarChar, 88);  
   parameter.IsNullable = true;  
   parameter.Direction = ParameterDirection.Output;  
}  

注解

Null 值使用 DBNull 类进行处理。

适用于

另请参阅