Export (0) Print
Expand All

OracleParameter.Value Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets or sets the value of the parameter.

[Visual Basic]
Public Overridable Property Value As Object  Implements _
   IDataParameter.Value
[C#]
public virtual object Value {get; set;}
[C++]
public: __property virtual Object* get_Value();
public: __property virtual void set_Value(Object*);
[JScript]
public function get Value() : Object;
public function set Value(Object);

Property Value

An Object that is the value of the parameter. The default value is null.

Implements

IDataParameter.Value

Remarks

For input parameters, the value is bound to the OracleCommand that is sent to the server. For output and return-value parameters, the value is set on completion of the OracleCommand and after the OracleDataReader is closed.

When sending a null parameter value to the server, the user must specify DBNull, not null. A null value in the system is an empty object that has no value. 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. The provider attempts 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.

The DbType, OracleType, and Size properties of a parameter can be inferred by setting Value. Therefore, you are not required to specify them. 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.

The InputOutput, Output, and ReturnValue ParameterDirection values used by the Value property will be .NET Framework data types, unless the input value was an Oracle data type (for example, OracleNumber or OracleString). This does not apply to REF CURSOR, BFILE, or LOB data types.

The Value property is overwritten by the Update method.

Example

[Visual Basic, C#, C++] The following example creates an OracleParameter and sets some of its properties.

[Visual Basic] 
Public Sub CreateOracleParameter()
    Dim myParameter As New OracleParameter("pDName", OracleType.VarChar)
    myParameter.Value = "ENGINEERING"
    myParameter.Size = 11
End Sub 'CreateOracleParameter

[C#] 
public void CreateOracleParameter() 
 {
    OracleParameter myParameter = new OracleParameter("pDName", OracleType.VarChar);
    myParameter.Value = "ENGINEERING";
    myParameter.Size = 11;
 }

[C++] 
public:
void CreateOracleParameter() 
 {
    OracleParameter* myParameter = new OracleParameter(S"pDName", OracleType::VarChar);
    myParameter->Value = S"ENGINEERING";
    myParameter->Size = 11;
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

OracleParameter Class | OracleParameter Members | System.Data.OracleClient Namespace | OracleType | DbType

Show:
© 2014 Microsoft