SqlParameter.IsNullable プロパティ

定義

パラメーターが null 値を受け入れるかどうかを示す値を取得または設定します。 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)]
[System.Data.DataSysDescription("DataParameter_IsNullable")]
public bool IsNullable { get; set; }
member this.IsNullable : bool with get, set
[<System.ComponentModel.Browsable(false)>]
[<System.Data.DataSysDescription("DataParameter_IsNullable")>]
member this.IsNullable : bool with get, set
Public Overrides Property IsNullable As Boolean
Public Property IsNullable As Boolean

プロパティ値

true null 値が受け入れられる場合。それ以外の場合は false。 既定値は false です。

属性

次の例では、 SqlParameter を作成し、そのプロパティの一部を設定します。

static void CreateSqlParameterNullable()
{
    SqlParameter parameter = new SqlParameter("Description", SqlDbType.VarChar, 88);
    parameter.IsNullable = true;
    parameter.Direction = ParameterDirection.Output;
}
Private Sub CreateSqlParameterNullable()
    Dim parameter As New SqlParameter("Description", SqlDbType.VarChar, 88)
    parameter.IsNullable = True
    parameter.Direction = ParameterDirection.Output
End Sub

注釈

null 値は、 DBNull クラスを使用して処理されます。

適用対象

こちらもご覧ください