SqlParameter.IsNullable Proprietà

Definizione

Ottiene o imposta un valore che indica se il parametro ammette valori Null. IsNullable non viene usata per convalidare il valore del parametro e non impedisce l'invio o la ricezione di un valore Null quando si esegue un comando.

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

Valore della proprietà

Boolean

true se sono ammessi valori Null; in caso contrario, false. Il valore predefinito è false.

Attributi

Esempio

L'esempio seguente crea un oggetto SqlParameter e imposta alcune delle relative proprietà.

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

Commenti

I valori Null vengono gestiti usando la DBNull classe .

Si applica a

Vedi anche