OracleParameterCollection OracleParameterCollection OracleParameterCollection OracleParameterCollection Class

Definition

Represents a collection of parameters relevant to an OracleCommand as well as their respective mappings to columns in a DataSet. This class cannot be inherited.

public ref class OracleParameterCollection sealed : System::Data::Common::DbParameterCollection
[System.ComponentModel.ListBindable(false)]
public sealed class OracleParameterCollection : System.Data.Common.DbParameterCollection
type OracleParameterCollection = class
    inherit DbParameterCollection
Public NotInheritable Class OracleParameterCollection
Inherits DbParameterCollection
Inheritance
OracleParameterCollectionOracleParameterCollectionOracleParameterCollectionOracleParameterCollection
Attributes

Examples

The following example creates multiple instances of OracleParameter through the OracleParameterCollection within the OracleDataAdapter. These parameters are used to select data within the database and then place the data in the DataSet. This example assumes that a DataSet and an OracleDataAdapter have already been created with the appropriate schema, commands, and connection.

public void AddOracleParameters() 
 {
 // ...
 // create dataSet and adapter
 // ...
   adapter.SelectCommand.Parameters.Add("pEName", OracleType.VarChar, 80).Value = "Smith";
   adapter.SelectCommand.Parameters.Add("pEmpNo", OracleType.Int32).Value = 7369;
   adapter.Fill(dataSet);
 }

Public Sub AddOracleParameters()
    ' ...
    ' create dataSet and adapter
    ' ...
adapter.SelectCommand.Parameters.Add("pEName", OracleType.VarChar, 80).Value = "Smith"
adapter.SelectCommand.Parameters.Add("pEmpNo", OracleType.Int32).Value = 7369
adapter.Fill(dataSet)
End Sub 

Remarks

When using named parameters, the number of parameters in the collection must be equal to the number of named parameters within the command text, or the .NET Framework Data Provider for Oracle raises an error.

The .NET Framework Data Provider for Oracle does not support the question mark (?) placeholder for passing parameters to an SQL statement called by an OracleCommand of CommandType.Text. In this case, named parameters must be used. For example:

SELECT * FROM Customers WHERE CustomerID = :pCustomerID  

When using named parameters in an SQL statement called by an OracleCommand of CommandType.Text, you must precede the parameter name with a colon (:). However, in a stored procedure, or when referring to a named parameter elsewhere in your code (for example, when adding OracleParameter objects to the Parameters property), do not precede the named parameter with a colon (:). The data provider supplies the colon automatically.

Constructors

OracleParameterCollection() OracleParameterCollection() OracleParameterCollection() OracleParameterCollection()

Initializes a new instance of the OracleParameterCollection class.

Properties

Count Count Count Count

Returns an Integer containing the number of elements in the OracleParameterCollection. Read-only.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

Gets a value that indicates whether the OracleParameterCollection has a fixed size.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value that indicates whether the OracleParameterCollection is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Gets a value that indicates whether the OracleParameterCollection is synchronized.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets or sets the OracleParameter at the specified index.

Item[String] Item[String] Item[String] Item[String]

Gets or sets the OracleParameter with the specified name.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets an object that can be used to synchronize access to the OracleParameterCollection.

Methods

Add(Object) Add(Object) Add(Object) Add(Object)

Adds the specified OracleParameter object to the OracleParameterCollection.

Add(OracleParameter) Add(OracleParameter) Add(OracleParameter) Add(OracleParameter)

Adds the specified OracleParameter to the OracleParameterCollection.

Add(String, Object) Add(String, Object) Add(String, Object) Add(String, Object)

Adds an OracleParameter to the OracleParameterCollection given the parameter name and value.

Add(String, OracleType) Add(String, OracleType) Add(String, OracleType) Add(String, OracleType)

Adds an OracleParameter to the OracleParameterCollection given the parameter name and data type.

Add(String, OracleType, Int32) Add(String, OracleType, Int32) Add(String, OracleType, Int32) Add(String, OracleType, Int32)

Adds an OracleParameter to the OracleParameterCollection given the parameter name, data type, and column length.

Add(String, OracleType, Int32, String) Add(String, OracleType, Int32, String) Add(String, OracleType, Int32, String) Add(String, OracleType, Int32, String)

Adds an OracleParameter to the OracleParameterCollection given the parameter name, data type, column length, and source column name.

AddRange(Array) AddRange(Array) AddRange(Array) AddRange(Array)

Adds an array of values to the end of the OracleParameterCollection.

AddRange(OracleParameter[]) AddRange(OracleParameter[]) AddRange(OracleParameter[]) AddRange(OracleParameter[])

Adds an array of OracleParameter values to the end of the OracleParameterCollection.

AddWithValue(String, Object) AddWithValue(String, Object) AddWithValue(String, Object) AddWithValue(String, Object)

Adds a value to the end of the OracleParameterCollection.

Clear() Clear() Clear() Clear()

Removes all of the OracleParameter objects from the OracleParameterCollection.

Contains(Object) Contains(Object) Contains(Object) Contains(Object)

Determines whether the specified object is in the OracleParameterCollection.

Contains(OracleParameter) Contains(OracleParameter) Contains(OracleParameter) Contains(OracleParameter)

Determines whether the specified OracleParameter is in the OracleParameterCollection.

Contains(String) Contains(String) Contains(String) Contains(String)

Indicates whether an OracleParameter with the specified name is contained in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Copies all the elements of the current OracleParameterCollection to the specified one-dimensional Array starting at the specified destination Array index.

CopyTo(OracleParameter[], Int32) CopyTo(OracleParameter[], Int32) CopyTo(OracleParameter[], Int32) CopyTo(OracleParameter[], Int32)

Copies all the elements of the current OracleParameterCollection to the specified OracleParameterCollection starting at the specified destination index.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the OracleParameterCollection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IndexOf(Object) IndexOf(Object) IndexOf(Object) IndexOf(Object)

Gets the location of the specified Object within the collection.

IndexOf(OracleParameter) IndexOf(OracleParameter) IndexOf(OracleParameter) IndexOf(OracleParameter)

Gets the location of the specified OracleParameter within the collection.

IndexOf(String) IndexOf(String) IndexOf(String) IndexOf(String)

Gets the location of the specified OracleParameter with the specified name.

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object)

Inserts a Object into the OracleParameterCollection at the specified index.

Insert(Int32, OracleParameter) Insert(Int32, OracleParameter) Insert(Int32, OracleParameter) Insert(Int32, OracleParameter)

Inserts a OracleParameter object into the OracleParameterCollection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
Remove(Object) Remove(Object) Remove(Object) Remove(Object)

Removes the specified OracleParameter object from the collection.

Remove(OracleParameter) Remove(OracleParameter) Remove(OracleParameter) Remove(OracleParameter)

Removes the specified OracleParameter object from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Removes the OracleParameter object at the specified index from the collection.

RemoveAt(String) RemoveAt(String) RemoveAt(String) RemoveAt(String)

Removes the OracleParameter object with the specified name from the collection.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to