OracleParameter.Value OracleParameter.Value OracleParameter.Value OracleParameter.Value Property

定义

获取或设置参数的值。Gets or sets the value of the parameter.

public:
 virtual property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))]
public override object Value { get; set; }
member this.Value : obj with get, set
Public Overrides Property Value As Object

属性值

一个对象,它是该参数的值。An object that is the value of the parameter. 默认值为 null。The default value is null.

实现

注解

用于输入参数的值绑定到OracleCommand,发送到服务器。For input parameters, the value is bound to the OracleCommand that is sent to the server. 对于输出参数和返回值参数,该数值将在完成OracleCommand前后OracleDataReader已关闭。For output and return-value parameters, the value is set on completion of the OracleCommand and after the OracleDataReader is closed.

为输入参数,Value可以设置为 Microsoft.NET Framework 数据类型或 Oracle 数据类型的对象 (例如,OracleNumberOracleString)。For an input parameter, Value can be set to an object of either a Microsoft .NET Framework data type or an Oracle data type (for example, an OracleNumber or OracleString).

当你向服务器发送 null 参数值时,必须指定 DBNull,不为 null。When you send a null parameter value to the server, you must specify DBNull, not null. 在系统中的 null 值是一个没有值的空对象。A null value in the system is an empty object that has no value. DBNull 用于表示 null 值。DBNull is used to represent null values.

如果应用程序指定的数据库类型,绑定的值转换为该类型时提供程序将数据发送到服务器。If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. 提供程序尝试转换任何类型的值,如果它支持IConvertible接口。The provider tries to convert any type of value if it supports the IConvertible interface. 如果指定的类型不兼容的值,可能会导致转换错误。Conversion errors may result if the specified type is not compatible with the value.

DbTypeOracleType,和Size参数的属性,可以通过将值设置推断出。The DbType, OracleType, and Size properties of a parameter can be inferred by setting Value. 因此,不需要指定它们。Therefore, you are not required to specify them. 但是,它们不会暴露在OracleParameter属性设置。However, they are not exposed in OracleParameter property settings. 例如,如果已推断出参数的大小,大小不包含推断的值在语句执行后。For example, if the size of the parameter has been inferred, Size does not contain inferred value after statement execution.

InputOutputOutput,并ReturnValueParameterDirection使用 Value 属性的值将是 Microsoft.NET Framework 数据类型,除非输入的值是 Oracle 数据类型 (例如,OracleNumberOracleString)。The InputOutput, Output, and ReturnValueParameterDirection values used by the Value property will be Microsoft .NET Framework data types, unless the input value was an Oracle data type (for example, OracleNumber or OracleString). 这不会应用于 REF CURSOR,BFILE 或 LOB 数据类型。This does not apply to REF CURSOR, BFILE, or LOB data types.

Value属性会被覆盖更新方法。The Value property is overwritten by the Update method.

适用于