OracleParameter OracleParameter OracleParameter OracleParameter Constructors

Definition

Overloads

OracleParameter() OracleParameter() OracleParameter()

Initializes a new instance of the OracleParameter class.

OracleParameter(String, OracleType) OracleParameter(String, OracleType) OracleParameter(String, OracleType)

Initializes a new instance of the OracleParameter class that uses the parameter name and data type.

OracleParameter(String, Object) OracleParameter(String, Object) OracleParameter(String, Object) OracleParameter(String, Object)

Initializes a new instance of the OracleParameter class that uses the parameter name and an OracleParameter object.

OracleParameter(String, OracleType, Int32) OracleParameter(String, OracleType, Int32) OracleParameter(String, OracleType, Int32)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, and length.

OracleParameter(String, OracleType, Int32, String) OracleParameter(String, OracleType, Int32, String) OracleParameter(String, OracleType, Int32, String)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, length, and source column name.

OracleParameter(String, OracleType, Int32, ParameterDirection, String, DataRowVersion, Boolean, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, String, DataRowVersion, Boolean, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, String, DataRowVersion, Boolean, Object)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, size, direction, source column, source version, and other properties.

OracleParameter(String, OracleType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, length, source column name, parameter direction, numeric precision, and other properties.

OracleParameter() OracleParameter() OracleParameter()

Initializes a new instance of the OracleParameter class.

public:
 OracleParameter();
public OracleParameter ();
Public Sub New ()

OracleParameter(String, OracleType) OracleParameter(String, OracleType) OracleParameter(String, OracleType)

Initializes a new instance of the OracleParameter class that uses the parameter name and data type.

public:
 OracleParameter(System::String ^ name, System::Data::OracleClient::OracleType oracleType);
public OracleParameter (string name, System.Data.OracleClient.OracleType oracleType);
new System.Data.OracleClient.OracleParameter : string * System.Data.OracleClient.OracleType -> System.Data.OracleClient.OracleParameter

Parameters

name
String String String String

The name of the parameter.

oracleType
OracleType OracleType OracleType OracleType

One of the OracleType values.

Exceptions

The value supplied in the oracleType parameter is an invalid back-end data type.

Examples

The following example creates an OracleParameter and sets some of its properties.

public void CreateOracleParameter() 
{
   OracleParameter parameter = new OracleParameter("DName",OracleType.VarChar);
   parameter.Direction = ParameterDirection.Output;
   parameter.Size = 14;
}
Public Sub CreateOracleParameter()
    Dim parameter As New OracleParameter("DName", OracleType.VarChar)
    parameter.Direction = ParameterDirection.Output
    parameter.Size = 14
End Sub 

OracleParameter(String, Object) OracleParameter(String, Object) OracleParameter(String, Object) OracleParameter(String, Object)

Initializes a new instance of the OracleParameter class that uses the parameter name and an OracleParameter object.

public:
 OracleParameter(System::String ^ name, System::Object ^ value);
public OracleParameter (string name, object value);
new System.Data.OracleClient.OracleParameter : string * obj -> System.Data.OracleClient.OracleParameter
Public Sub New (name As String, value As Object)

Parameters

name
String String String String

The name of the parameter.

Remarks

When you specify an Object in the value parameter, the DbType is inferred from the Microsoft .NET Framework type of the Object.

Use caution when you are using this overload of the OracleParameter constructor. Because this overload takes a value of type Object, you must convert the integral value to an Object type when the value is zero, as the following Microsoft Visual C# example demonstrates.

Parameter = new OracleParameter("pname", Convert.ToInt32(0));  

If you do not perform this conversion, the compiler will assume that you are trying to call the OracleParameter(string, OracleType) constructor overload.

OracleParameter(String, OracleType, Int32) OracleParameter(String, OracleType, Int32) OracleParameter(String, OracleType, Int32)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, and length.

public:
 OracleParameter(System::String ^ name, System::Data::OracleClient::OracleType oracleType, int size);
public OracleParameter (string name, System.Data.OracleClient.OracleType oracleType, int size);
new System.Data.OracleClient.OracleParameter : string * System.Data.OracleClient.OracleType * int -> System.Data.OracleClient.OracleParameter

Parameters

name
String String String String

The name of the parameter.

oracleType
OracleType OracleType OracleType OracleType

One of the OracleType values.

size
Int32 Int32 Int32 Int32

The length of the parameter.

Exceptions

The value supplied in the oracleType parameter is an invalid back-end data type.

Examples

The following example creates an OracleParameter and sets some of its properties.

public void CreateOracleParameter() 
{
   OracleParameter parameter = new OracleParameter("DName",OracleType.VarChar,14);
   parameter.Direction = ParameterDirection.Output;
}
Public Sub CreateOracleParameter()
    Dim parameter As New OracleParameter("DName", OracleType.VarChar, 14)
    parameter.Direction = ParameterDirection.Output
End Sub 

OracleParameter(String, OracleType, Int32, String) OracleParameter(String, OracleType, Int32, String) OracleParameter(String, OracleType, Int32, String)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, length, and source column name.

public:
 OracleParameter(System::String ^ name, System::Data::OracleClient::OracleType oracleType, int size, System::String ^ srcColumn);
public OracleParameter (string name, System.Data.OracleClient.OracleType oracleType, int size, string srcColumn);
new System.Data.OracleClient.OracleParameter : string * System.Data.OracleClient.OracleType * int * string -> System.Data.OracleClient.OracleParameter

Parameters

name
String String String String

The name of the parameter.

oracleType
OracleType OracleType OracleType OracleType

One of the OracleType values.

size
Int32 Int32 Int32 Int32

The length of the parameter.

srcColumn
String String String String

The name of the source column.

Exceptions

The value supplied in the oracleType parameter is an invalid back-end data type.

Examples

The following example creates an OracleParameter and sets some of its properties.

public void CreateOracleParameter() 
{
   OracleParameter parameter = new OracleParameter("DName",OracleType.VarChar,
                14,"DName");
   parameter.Direction = ParameterDirection.Output;
}
Public Sub CreateOracleParameter()
    Dim parameter As New OracleParameter("DName", OracleType.VarChar, 14, "DName")
    parameter.Direction = ParameterDirection.Output
End Sub 

OracleParameter(String, OracleType, Int32, ParameterDirection, String, DataRowVersion, Boolean, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, String, DataRowVersion, Boolean, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, String, DataRowVersion, Boolean, Object)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, size, direction, source column, source version, and other properties.

public:
 OracleParameter(System::String ^ name, System::Data::OracleClient::OracleType oracleType, int size, System::Data::ParameterDirection direction, System::String ^ sourceColumn, System::Data::DataRowVersion sourceVersion, bool sourceColumnNullMapping, System::Object ^ value);
public OracleParameter (string name, System.Data.OracleClient.OracleType oracleType, int size, System.Data.ParameterDirection direction, string sourceColumn, System.Data.DataRowVersion sourceVersion, bool sourceColumnNullMapping, object value);
new System.Data.OracleClient.OracleParameter : string * System.Data.OracleClient.OracleType * int * System.Data.ParameterDirection * string * System.Data.DataRowVersion * bool * obj -> System.Data.OracleClient.OracleParameter

Parameters

name
String String String String

The name of the parameter to map.

oracleType
OracleType OracleType OracleType OracleType

One of the OracleType values.

size
Int32 Int32 Int32 Int32

The length of the parameter.

sourceColumn
String String String String

The name of the source column.

sourceColumnNullMapping
Boolean Boolean Boolean Boolean

true if the source column is nullable, otherwise false.

value
Object Object Object Object

An Object that is the value of the OracleParameter.

Exceptions

The value supplied in the oracleType parameter is an invalid back-end data type.

OracleParameter(String, OracleType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) OracleParameter(String, OracleType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object)

Initializes a new instance of the OracleParameter class that uses the parameter name, data type, length, source column name, parameter direction, numeric precision, and other properties.

public:
 OracleParameter(System::String ^ name, System::Data::OracleClient::OracleType oracleType, int size, System::Data::ParameterDirection direction, bool isNullable, System::Byte precision, System::Byte scale, System::String ^ srcColumn, System::Data::DataRowVersion srcVersion, System::Object ^ value);
public OracleParameter (string name, System.Data.OracleClient.OracleType oracleType, int size, System.Data.ParameterDirection direction, bool isNullable, byte precision, byte scale, string srcColumn, System.Data.DataRowVersion srcVersion, object value);
new System.Data.OracleClient.OracleParameter : string * System.Data.OracleClient.OracleType * int * System.Data.ParameterDirection * bool * byte * byte * string * System.Data.DataRowVersion * obj -> System.Data.OracleClient.OracleParameter

Parameters

name
String String String String

The name of the parameter.

oracleType
OracleType OracleType OracleType OracleType

One of the OracleType values.

size
Int32 Int32 Int32 Int32

The length of the parameter.

isNullable
Boolean Boolean Boolean Boolean

true if the value of the field can be null, otherwise, false.

precision
Byte Byte Byte Byte

The total number of digits to the left and right of the decimal point to which Value is resolved.

scale
Byte Byte Byte Byte

The total number of decimal places to which Value is resolved.

srcColumn
String String String String

The name of the source column.

value
Object Object Object Object

An Object that is the value of the OracleParameter.

Exceptions

The value supplied in the oracleType parameter is an invalid back-end data type.

Examples

The following example creates an OracleParameter and displays the ParameterName.

public void CreateOracleParameter() 
 {
    OracleParameter parameter = new OracleParameter(
        "DName",OracleType.VarChar,
        11,ParameterDirection.Output,true,0,0,"DName",
        DataRowVersion.Current,"ENGINEERING");
    Console.WriteLine(parameter.ToString());
 }
Public Sub CreateOracleParameter()
    Dim parameter As New OracleParameter( _
        "DName", OracleType.VarChar, 11, _
        ParameterDirection.Output, True, 0, 0, _
        "DName", DataRowVersion.Current, "ENGINEERING")
    Console.WriteLine(parameter.ToString())
End Sub 

Applies to