SqlParameter.IsNullable Propiedad

Definición

Obtiene o establece un valor que indica si el parámetro acepta valores null. IsNullable no se usa para validar el valor del parámetro ni evita el envío o la recepción de un valor null al ejecutar 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

Valor de propiedad

true si se aceptan valores null; de lo contrario, false. De manera predeterminada, es false.

Atributos

Ejemplos

En el ejemplo siguiente se crea y SqlParameter se establecen algunas de sus propiedades.

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

Comentarios

Los valores NULL se controlan mediante la DBNull clase .

Se aplica a

Consulte también