DbParameter.Value Propriedade

Definição

Obtém ou define o valor do parâmetro.Gets or sets the value of the parameter.

public:
 abstract property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };
public abstract object Value { get; set; }
public abstract object? Value { get; set; }
member this.Value : obj with get, set
Public MustOverride Property Value As Object

Valor da propriedade

Object

Um Object que é o valor do parâmetro.An Object that is the value of the parameter. O valor padrão é nulo.The default value is null.

Implementações

Comentários

Para parâmetros de entrada, o valor é associado ao DbCommand que é enviado para o servidor.For input parameters, the value is bound to the DbCommand that is sent to the server. Para parâmetros de saída e valor de retorno, o valor é definido na conclusão do DbCommand e após o DbDataReader ser fechado.For output and return value parameters, the value is set on completion of the DbCommand and after the DbDataReader is closed.

Ao enviar um valor de parâmetro nulo para o servidor, você deve especificar DBNull , não nulo.When you send a null parameter value to the server, you must specify DBNull, not null. O valor nulo no sistema é um objeto vazio, que não tem valor.The null value in the system is an empty object that has no value. DBNull é usado para representar valores nulos.DBNull is used to represent null values.

Se o aplicativo especificar o tipo de banco de dados, o valor associado será convertido nesse tipo quando o provedor enviar os dados para o servidor.If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. O provedor tentará converter qualquer tipo de valor se ele der suporte à IConvertible interface.The provider tries to convert any type of value if it supports the IConvertible interface. Erros de conversão podem ocorrer se o tipo especificado não for compatível com o valor.Conversion errors may result if the specified type is not compatible with the value.

A DbType propriedade pode ser inferida definindo o valor.The DbType property can be inferred by setting the Value.

A Value propriedade é substituída por DbDataAdapter.Update .The Value property is overwritten by DbDataAdapter.Update.

Aplica-se a