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

속성 값

null 값이 허용되면 true이고, 그렇지 않으면 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 사용하여 처리됩니다.

적용 대상

추가 정보