Oracle Data Provider Classes
- Last Updated: April 16, 2026
- 23 minute read
- ADO.NET
- Documentation
The Oracle data provider supports the public classes, properties, and methods as described in the Microsoft .NET Framework SDK documentation. The Oracle data provider attaches the provider-specific prefix "Oracle" to the public .NET classes, for example, OracleCommand.
This section describes the provider-specific properties and methods of the Oracle data provider.
Note: This section applies to both Oracle data providers. See Supported Properties and Methods for information on the differences for the Oracle Entity Framework data provider.
OracleBulkCopy
The OracleBulkCopy class uses a model similar to the Microsoft SqlBulkCopy class, and has no provider-specific properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
OracleBulkCopyColumnMapping
The OracleBulkCopyColumnMapping class uses an API pattern similar to the ADO.NET Bulk API patterns, and has no provider-specific properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
OracleBulkCopyColumnMappingCollection
The OracleBulkCopyColumnMappingCollection class follows an API pattern similar to the Microsoft SqlBulkCopyColumnMappingCollection class, and has no provider-specific properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
OracleCommand Class
The following table lists the provider-specific public properties of the OracleCommand class. The table includes the generic public properties of the Command class when provider-specific information supplements the standard descriptions. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
Public Properties of the OracleCommand Class
| Property | Description |
| AddRowID | Specifies whether the data provider adds the ROWID column to the Select list of a SQL statement. When set to True, the values returned in the ROWID column are used to generate more efficient Insert, Delete, and Update commands when using the OracleCommandBuilder. When set to False (the initial default) the data provider does not add the ROWID column to the Select list. |
| ArrayBindCount | Specifies the number of rows of parameters that will be used. The application must set this property before executing a command that uses parameter array binding. The count must equal the length of each of the arrays that is set for each parameter value. When set to 0 (the initial default), the application will not use parameter array binding. Note: The application cannot influence this bind count on top of the ADO.NET Entity Framework. |
| ArrayBindStatus | Enables the application to inspect the per row status after executing a command that uses parameter array binding. The property's type is an array of OracleRowStatus. Parameter array binding is performed as a single atomic operation. This means that if the operation succeeds, every entry will be set to OK; if the operation fails, none of the entries will be set to OK. The OracleRowStatus enumeration has the following possible values:
|
| BindByName | Specifies how the data provider processes named parameters when executing a stored procedure. The application can use named parameters or use default values for parameters to the stored procedure. When set to True, the data provider uses the names of parameters supplied in the OracleParameter class for the parameter bindings to the Oracle server. Alternatively, the user can specify a default value for a named parameter using either of the following methods:
When set to False (the initial default), the data provider ignores the names for the parameters supplied in the OracleParameter objects, and assumes that the parameters are in the same order as they were specified in the Create Procedure statement. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| CommandTimeout | Gets or sets the wait time before terminating the attempt to execute a command and generating an error. The initial default is 30 seconds. We recommend that the application sets the CommandTimeout property to a value that is greater than the largest default timeout value on the server. This ensures that the application gets a more meaningful reply in case of a timeout. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts for command timeouts. |
| RowSetFetchSize | Specifies at the command level the number of rows to be returned for each round trip between the application and the server. The maximum value is 32767. When set to 0 (the initial default), the number of rows fetched at a time is based on the Fetch Array Size connection string option. |
| RowSetSize | Limits the number of rows returned by any query executed on this Command object to the value specified at execute time. Valid values are 0 to 2147483647. When set to 0 (the initial default), the data provider does not limit the number of rows returned. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts to limit the number of rows returned. |
| StatementCacheBehavior | Retrieves or sets the statement cache behavior of the Command object to one of the values of the StatementCacheBehavior enumeration. See Enabling Statement Caching for more information. When set to Implicit (the default) and the Statement Cache Mode connection string option is set to Auto, statement caching occurs implicitly. When set to Cache and the Statement Cache Mode connection string option is set to ExplicitOnly, statements identified as Cache are cached. When set to DoNotCache, statement caching does not occur. |
| UpdatedRowSource | Gets or sets how command results are applied to the DataRow, when used by the Update method of a DataAdapter. When the UpdateBatchSize property is set to a value other than 1, UpdatedRowSource property for UpdateCommand, DeleteCommand, and InsertCommand must be set to None or OutputParameters. When set to None, any returned parameters or rows are ignored. When set to OutputParameters, output parameters are mapped to the changed row in the DataSet. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
OracleCommandBuilder Class
Using a CommandBuilder class can have a negative effect on performance. Because of concurrency restrictions, the CommandBuilder can generate highly inefficient SQL statements. The end user can often write more efficient Update and Delete statements than those that the CommandBuilder generates.
For information about the properties supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
The following table lists the provider-specific public methods of the OracleCommandBuilder class. For a description of the other methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
Public Methods of the OracleCommandBuilder Class
| Method | Description |
| DeriveParameters | Populates the specified OracleCommand class's Parameters collection with parameter information for a stored procedure specified in the OracleCommand. Because the data provider cannot anticipate the number of items returned by an argument of PL/SQL TABLE type, a default count of 255 is used. You may need to override this count for use with the Size property. See "OracleParameter Class" for more information. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
OracleConnection Class
The following table lists the provider-specific public constructors of the OracleConnection class.
Public Constructors of the OracleConnection Class
| Constructor | Description |
| OracleConnection() | Initializes a new instance of the OracleConnection class. |
| OracleConnection(string connectionString) | Initializes a new instance of the OracleConnection class when given a string that contains the connection string. |
| OracleConnection(string connectionString, OracleCredential credential) | Initializes a new instance of the OracleConnection class given a connection string and an OracleCredential object that contains the user ID and password. |
The following table lists the provider-specific public properties of the OracleConnection class. Some properties return the values specified for the corresponding connection string option. See Connection String Options for more information. For a description of other properties supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
Public Properties of the OracleConnection Class
| Property | Description |
| ConnectionString | Gets or sets the string used to open a database. See Connection String Options for a description of the values you can set. |
| ConnectionTimeout | Gets the time to wait while trying to establish a connection, before terminating the attempt and generating an error. You can set the amount of time a connection waits to time out by using the ConnectTimeout property or the Connection Timeout connection string option. If connection failover is enabled (the Alternate Servers connection string option defines one or more alternate database servers), this property applies to each attempt to connect to an alternate server. If connection retry is also enabled (the Connection Retry Count connection string option is set to an integer greater than 0), the ConnectionTimeout property applies to each retry attempt. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| CurrentPassword | Gets or sets the current password. This property is used to control impersonation of the user specified in the connection string. The default value is an empty string. The CurrentPassword property can only be set when the connection is not open. |
| CurrentUser | Gets the currently authorized user specified by the UserName, or sets the current authorized user to a new value. When no value is defined, the data provider uses the user defined in the connection string. If the currently authorized user is not the same as the user defined in the original connection string, the data provider restores the user name, schema, path, and database. See Using Reauthentication for a description of OS authentication in a connection pool. For the Entity Framework data provider, use the DDTek_Connection_Reauthenticate stored procedure. See Using Stored Procedures with the ADO.NET Entity Framework for information on using this functionality in an ADO.NET Entity Framework application. |
| CurrentUserAffinityTimeout | Gets or sets the affinity timeout associated with the CurrentUser property. The value is expressed in milliseconds. The property helps the connection pool avoid unnecessary reauthentication. If CurrentUser is specified and the connection pool contains a physical connection that matches the CurrentUser, Open will occur more quickly. Increasing the CurrentUserAffinityTimeout can increase the chances that a connection with the same CurrentUser exists in the pool. However, when set too high, the connection pool might have to create new connections, which is more performance-expensive than reauthenticating an existing connection. The initial default is 0. The property’s value cannot be changed when the connection is open. Attempting to do so will result in an InvalidOperation exception. The property’s value is ignored if any of the following are true:
For the Entity Framework data provider, use the DDTek_Connection_Reauthenticate stored procedure. See Using Stored Procedures with the ADO.NET Entity Framework for information on using this functionality in an ADO.NET Entity Framework application. |
| CursorDescriptionCache | Returns the value specified for the Cursor Description Cache connection string option. Read-only. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| Database | Gets the name of the current database or the database to be used after a connection is opened. |
| DatabaseCharacterSetName | Set by the data provider on connection with the IANA name for the character set in the database to which the data provider has connected. Read-only. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| DataSource | Gets the Hostname of the Oracle server to which to connect. |
| FetchArraySize | Returns the value specified for the Fetch Array Size connection string option. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| Host | Returns the name of the host to which the data provider is connected. This is the value specified for the Host connection string option, or from the tnsnames.ora file, if that was used during connection. The data provider predicts which host will be used for the connection, based on information in the connection string. If a change occurs while the connection is being established, for example, an alternate server is used, the Host property reports the actual host to which the data provider is connected. Note: When the connection string uses the Data Source option, this property reports the value obtained from the tnsnames.ora file. |
| NationalCharacterSetName | Set by the data provider on connection with the national character set in the database to which the data provider has connected. Read-only. |
| Port | Returns the name of the port to which the data provider is connected. This is the value specified for the Port connection string option, or from the tnsnames.ora file, if that was used during connection. The data provider predicts which port will be used for the connection, based on information in the connection string. If a change occurs during connection, for example, an alternate server is used, the Port property reports the actual port to which the data provider is connected. Note: When the connection string uses the Data Source option, this property reports the value obtained from the tnsnames.ora file. |
| ServerName | Returns the value specified for the Server Name connection string option. Read-only. |
| ServiceName | Returns the Service Name. This is the value specified for the Service Name connection string option, or from the tnsnames.ora file, if that was used during connection. Read-only. The data provider predicts which Service Name will be used for the connection, based on information in the connection string. If a change occurs during connection, for example, an alternate server is used, the ServiceName property reports the actual Service Name the data provider is using. Note: When the connection string uses the Data Source option, this property reports the value obtained from the tnsnames.ora file. |
| SID | Returns the SID. This is the value specified for the SID connection string option, or from the tnsnames.ora file, if that was used during connection. The data provider predicts which SID will be used for the connection, based on information in the connection string. If a change occurs during connection, for example, an alternate server is used, the SID property reports the actual SID the data provider is using. Note: When the connection string uses the Data Source option, this property reports the value obtained from the tnsnames.ora file. |
| StatisticsEnabled | Enables statistics gathering. When set to True, enables statistics gathering for the current connection. |
| TNSNamesFile | Returns the value specified for the TNSNames File connection string option. Read-only. The data provider predicts which tnsnames.ora file will be used for the connection, based on information in the connection string. If a change occurs during connection, for example, an alternate tnsnames.ora file location is used, the TNSNamesFile property reports the actual tnsnames.ora file location to which the data provider is connected. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| Credential | Provides a more secure way to specify the password for a login attempt using Oracle Server Authentication. OracleCredential is comprised of a user id and a password that will be used for Oracle Server Authentication. The SecureString object which holds the password should be marked Read-Only. |
The following table lists the provider-specific public methods of the OracleConnection class. For a description of the other methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
Public Methods of the OracleConnection Class
| Method | Description |
| BeginTransaction() | Begins a transaction at the Oracle database. When using the overloaded BeginTransaction(IsolationLevel) method, the Oracle data provider supports isolation levels ReadCommitted and Serializable. Refer to the DataDirect Connect Series for ADO.NET Reference for more information. |
| Close | Closes the connection to the database and returns the connection to the connection pool. The connection string settings remain as they were before the Open was called. The Close(OracleCloseBehavior) method by default returns the connection to the pool if connection pooling is active. If the behavior parameter is set to DoNotPool, the connection to the server is closed. If closing the connection causes the connection pool to have fewer connections than specified by the Min Pool Size connection option, a new connection is created and added to the pool. The Microsoft .NET Framework SDK documentation notes that Close is the preferred method of closing a connection. |
| EnlistDistributedTransaction | This method is obsolete. Use the EnlistTransaction method. |
| EnlistTransaction | Enlists in the specified transaction as a distributed transaction. |
| GetAvailableNetServiceNames | Returns all of the available net service names from an Oracle tnsnames.ora file as a String collection. The function is defined as follows: Public static string[] GetAvailableNetServiceNames (string tnsFileName); The tnsFileName parameter is optional. When specified, it must identify the path to the tnsnames.ora file (including the file name). The path can be a file system path or an HTTP address. If null is passed as the tnsFileName parameter, the data provider attempts to find the tnsnames.ora file by using the value for OracleHome in the Oracle section of the Registry. The following example shows how this function can be used as the input to a ComboBox: ComboBox comboBox1; To bind the function to the list, do the following: comboBox1.DataSource = OracleConnection.GetAvailableNetServiceNames ("C:\Oracle\Network\Admin\tnsnames.ora"); Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| OpenWithNewPassword() | Establishes a new connection with a new password when the password defined by the Password connection string option has expired. Applications can specify a password that is used only when the server rejects an expired password. The expired password must be specified in the connection string as a value for the Password connection string option. Note: This operation must establish a fresh connection. When the connection is closed, it should not be returned to the connection pool. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| ResetStatistics | Resets all values to zero in the current statistics gathering session on the connection. When the connection is closed and returned to the connection pool, statistics gathering is switched off and the counts are reset. |
| RetrieveStatistics | Retrieves a set of statistics for a connection that is enabled for statistics gathering (see the StatisticsEnabled property). The set of name=value pairs returned forms a "snapshot in time" of the state of the connection when the method is called. |
| SetOEMLicenseInfo | The SetOEMLicenseInfo method is for Progress DataDirect OEM customers only. Refer to the DataDirect Connect Series for ADO.NET Distribution Guide. The OEM customer must explicitly add a reference to the ADO.NET data provider, and then call the DDTek.Oracle.OracleConnection.SetOEMLicenseInfo method. |
| StatisticsEnabled | Use the StatisticsEnabled or StatisticsDisabled stored procedure. NOTES:
|
OracleCredential Class
OracleCredential provides a more secure way to specify the password for a login attempt using Oracle Server Authentication. OracleCredential is comprised of a user id and a password that will be used for Oracle Server Authentication.
The password in a OracleCredential object is of type SecureString, unlike Connection String where password remains unsecure till the point where provider reads it and converts it to SecureString. The password is converted to string/ byte array in a secured way so that the conversion logic does not write the password in the memory. Any string where password is stored is cleaned after use.
Note: OracleCredential should not be used when the Authentication Method does not need user id and password. So, if you are using NTLM or Kerberos or Client or ClientO3Logon, you should not use OracleCredential.
Note: The Connection String should not have the User id and password when the Credential object is being used.
The following code snippet shows how the OracleCredential class can be used:
OracleConnection con = null;
OracleCredential lobjCredential = null;
string userId = "ABCD";
SecureString password = ConvertToSecureString("XYXYX");
private static SecureString ConvertToSecureString(string value)
{
var securePassword = new SecureString();
foreach (char c in value.ToCharArray())
securePassword.AppendChar(c);
securePassword.MakeReadOnly();
return securePassword;
}
try
{
lobjCredential = new OracleCredential(userId, password);
con = new OracleConnection("Host=ac-xyz911.americas.company.com;port=1521;sid=CP31", lobjCredential);
con.Open();
Console.WriteLine("Connection Successfully Opened...");
con.Close();
}
catch (Exception e)
{
Console.Write(e.Message)
}
finally
{
if (null != con)
{
con.Close();
con = null;
}
if (null != lobjCredential)
lobjCredential = null;
}
Note: The method followed to convert a string into a SecureString in this example is one of many possible methods you can use.
[The following table lists the provider-specific implementation of the public properties of the OracleConnection class.
Public Properties of the OracleCredential Class
| Property | Description |
| User ID | Returns the user ID component of the OracleCredential object. Uses String data type. Invalid Values - NULL or empty. |
| Password | Returns the password component of the OracleCredential object. Uses SecureString data type. Invalid Values - NULL |
Note: If you are using Credential objects while opening the connection and want to use the same pooled connection, you need to use the same Credential object (Reference equal). Only then the same connection will be fetched from the available connection pool.
If you create a new Credential object for each connection, the driver will treat them as separate connection and put them into different connection pools. (Even if you use the same user id and password)
OracleConnectionFactory Class
The data provider implements IDbConnectionFactory by a class named OracleConnectionFactory. This class allows you to use the OracleEntity provider as the default data provider using the Database.DefaultConnectionFactory property. The OracleConnectionFactory class provides support for passing a connection string to the DbContext constructor. Because Oracle does not support multiple databases, OracleConnectionFactory cannot pass a database name.
The following code snippet shows how the OracleConnectionFactory class can be used:
Database.DefaultConnectionFactory = new OracleConnectionFactory();
EF41SampleContext context = new EF41SampleContext("Host=nc-colts;
Password=TEST38; Port=1521; SID=CP871; User ID=TEST38");
context.Pocos.Add(poco);
context.SaveChanges();
Note that if a connectionString was passed into the DbContext constructor as in the example, the Entity Framework would attempt to create a new SqlCeConnection using the connection string. By setting the DefaultConnectionFactory to an OracleConnectionFactory instance, the Entity Framework will instead use an OracleConnection.
The OracleConnectionFactory also lets you specify a "base" connectionString to use which may act as a default connection string.
The OracleConnectionFactory class has no provider-specific public methods or properties. For information about the IDbConnectionFactory class, refer to the Microsoft .NET Framework SDK documentation.
OracleConnectionStringBuilder Class
TheOracleConnectionStringBuilder class has no provider-specific public methods. For information about the methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
OracleConnectionStringBuilder property names are the same as the connection string option names of the OracleConnection class. However, the connection string option name has spaces between the words. For example, the connection string option name Alternate Servers is equivalent to the property name AlternateServers.
See Oracle Data Provider Connection String Options for the connection option descriptions, which are listed alphabetically by the connection string option name. The ConnectionStringBuilder property name is listed immediately underneath the GUI name.
OracleDataAdapter Class
The following table lists the provider-specific implementation of the public properties of the DB2DataAdapter class. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
Public Properties of the OracleDataAdapter Class
| Property | Description |
| UpdateBatchSize | Gets or sets a value that specifies the number of commands that can be executed in a batch. If your application uses disconnected DataSets and updates those DataSets, you can positively influence performance by setting this property to a value greater than 1. By default, the data provider attempts to use the largest batch size possible. However, this may not equate to optimal performance for your application. Set the value based on the number of rows you typically update in the DataSet. For example, if you update less than 50 rows, set this property to 25. When set to 0, the OracleDataAdapter uses the largest batch size the data source can support. The UpdatedRowSource property must be set to None or OutputParameters. When set to 1, batch updating is disabled. When set to a value greater than 1, the specified number of commands are executed in a batch. The UpdatedRowSource property for the InsertCommand, UpdateCommand, and DeleteCommand must be set to None or OutputParameters. If your application 1) uses batch operations for inserts, updates, or deletes and 2) performs these operations on many values in the same columns, the data provider can use array binding to optimize batch updates. In this case, set the Batch Update Behavior connection string option to ArrayBindWhenPossible. If your application 1) uses batch operations for inserts only and 2) inserts many values in the same columns, the data provider can use array binding to optimize batch inserts. Set this option to ArrayBindOnlyInserts. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
OracleDataReader Class
The OracleDataReader class has no provider-specific properties. For a description of the properties supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
The following table lists the public methods of the OracleDataReader class that have provider-specific information. For a description of the other methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.
Public Methods of the OracleDataReader Class
| Method | Description |
| GetChars | Reads a stream of characters into the buffer as an array, starting from the specified buffer offset of the specified column offset. The XML column is returned as character data. |
| GetString | Gets the value of a specified column as a string. The XML column is returned as character data. |
| GetValue | Gets value of a column at a specified ordinal, returning the value in the column's native format. If the Xml Describe Type connection string option is set to string, the XML column is returned as character data. If the Xml Describe Type connection string option is set to binary, the XML column is returned in its raw binary form. |
| GetValues | Gets all of the attribute columns in the current row. The XML column is returned as character data. The XML column is returned as character data or in its raw binary form, depending on the value of the Xml As String connection string option. |
| GetXmlReader | Overloaded method that returns an XmlReader instance from the XML column. No conversion of the data is done. GetXmlReader(Int32) returns the zero-based column ordinal. GetXmlReader(Int32,XmlReaderSettings) returns the zero-based column ordinal and the XmlReaderSettings instance used to configure the XmlReader. GetXmlReader(Int32,XmlReaderSettings,XmlParserContext) returns the zero-based column ordinal, the XmlReaderSettings instance used to configure the XmlReader, and the XmlParserContext instance used to provide context information required to parse the XML fragment. |
OracleError Class
The following table lists the provider-specific public properties of the OracleError class. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
Public Properties of the OracleError Class
| Property | Description |
| ErrorPosition | Specifies the offset in the SQL statement for which the error applies. The initial default is 0. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
| SQLState | Gets the string representation of the SQL State when the Oracle data provider throws an exception. This property is read-only. Note: The Entity Framework data provider uses the ADO.NET Entity Framework programming contexts. |
OracleErrorCollection Class
The following table lists the provider-specific public properties of the ErrorCollection class. For information about other supported properties, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
Public Properties of the OracleErrorCollection Class
| Property | Description |
| IsSynchronized | Gets a value indicating whether the OracleErrorCollection is synchronized (thread-safe). |
| SyncRoot | Gets the object used to synchronize access to the OracleErrorCollection. |
OracleException Class
Provider-specific exceptions are derived directly from the System.Data interface. Only the public properties and methods, for example, the Message property, are directly available on the System.Exception object in a generic sense. The SQLState and Number properties are only accessible through provider-specific code or by using reflection.
ADO.NET 2.0 introduced the Data property on the DbException class. This property returns a collection of key-value pair tuples that provide additional user-defined information about an exception. The Oracle data provider gets a collection of key/value pairs such as SQLState, Number, and ErrorPosition.
The DDTek prefix is applied to each key, for example:
DDTek.Data["SQLState"] = 28000;
The following table lists the provider-specific public properties of the OracleException class. The properties apply to the last error generated, if multiple errors exist. See OracleErrorCollection Class for more information. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
Public Properties of the OracleException Class
| Property | Description |
| ErrorPosition | Returns the offset in the SQL statement for which the error applies. The data provider returns 0 if the offset is not applicable to the error. |
| SQLState | Returns the SQLState value when an exception is thrown by the Oracle data provider. For example, if the data provider returns 28000, the authorization name is invalid. |
OracleFactory Class
Provider Factory classes allow users to program to generic objects. Once instantiated from DbProviderFactory, the factory generates the proper type of concrete class.
The following table lists the static methods used to accommodate choosing the Oracle data provider and instantiating its DbProviderFactory.
Methods of the OracleFactory Class
| Method | Description |
| CreateCommand | Returns a strongly typed DbCommand instance. |
| CreateCommandBuilder | Returns a strongly typed DbCommandBuilder instance. |
| CreateConnection | Returns a strongly typed DbConnection instance. |
| CreateConnectionStringBuilder | Returns a strongly typed DbConnectionString instance. |
| CreateDataAdapter | Returns a strongly typed DbDataAdapter instance. |
| CreateDataSourceEnumerator | Returns a strongly typed OracleDataSourceEnumerator instance. |
| CreateParameter | Returns a strongly typed DbParameter instance. |
OracleInfoMessageEventArgs Class
The OracleInfoMessageEventArgs class is passed as an input to the OracleInfoMessageEventHandler and contains information relevant to a warning generated by the Oracle server.
The OracleInfoMessageEventArgs class has no provider-specific properties or methods. For information about the properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
OracleParameter Class
The following table lists the provider-specific public properties of the OracleParameter class. The table includes the generic public properties of the Parameter class when provider-specific information supplements the standard descriptions. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
When the UseNamedParameters property of the OracleCommand class is set to True, the Oracle data provider uses the names of parameters supplied in the OracleParameter objects for the parameter binding to the Oracle server. See OracleCommand Class for more information.
Note: When executing a stored procedure, the data provider by default assumes that the parameters supplied are in the same order as they were specified in the Create Procedure statement. The names of parameters supplied in the OracleParameter object are ignored.
Public Properties of the OracleParameter Class
| Property | Description |
| ArrayBindStatus | Determines whether any values in the array of OracleParameterStatus entries should be bound as null. The OracleParameterStatus enumeration contains the entry NullValue. When this property is not set, then no values are null. The length of the array should match the amount specified by the OracleCommand class's ArrayBindCount property (See "OracleCommand Class"). To support arguments of type PL/SQL Table, the data provider populates the array when the parameter is being used to retrieve an array of output values. The initial default is null. |
| CollectionType | Specifies the collection type of the parameter. Specify PLSQLAssociativeArray when the parameter is being bound to a PL/SQL Associative Array as an input, input/output, or output parameter to a stored procedure or function. Setting this property to PLSQLAssociativeArray implies the value of the parameter is an array of values. For output or input/output parameters, the Size property must be set to a maximum anticipated number of elements to be returned. The initial default is None. |
| OracleDbType | Gets or sets the DbType of the parameter. |
| Size | Gets or sets the maximum size, in bytes, of the data within the column. To specify a parameter of type PL/SQL Associative Array, set the Size property to the maximum number of anticipated elements and set the CollectionType property to PLSQLAssociativeArray. |
| Value | Gets or sets the value of the parameter. When array binding is enabled (see the ArrayBindCount property of the "OracleCommand Class"), this property is specified as an array of values. Each array's length must match the value of the ArrayBindCount property. When specifying the array's values for binary type columns, the data will actually be specified as byte[]. This is an array of arrays of bytes. The data provider anticipates a jagged array as such when using parameter array binding with parameters. To enable input of large binary or text values, set this property to an instance of the Stream or TextReader stream object (See Using the ROWID Pseudo-Column). If the parameter is an input or input/output parameter and the OracleCollection is set to PL/SQL AssociativeArray, set this property to an array of values for input to the stored procedure. When set to null for a stored procedure parameter, the data provider does not send the parameter to the server. Instead, the default value for the parameter is used when executing the stored procedure. |
OracleParameterCollection
The following table lists the provider-specific public properties of the OracleParameterCollection class. The table includes the generic public properties of the ParameterCollection class when provider-specific information supplements the standard descriptions. For a description of other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
Public Properties of the OracleParameterCollection Class
| Property | Description |
| IsFixedSize | Gets a value that indicates whether the OracleParameterCollection has a fixed size. |
| IsReadOnly | Gets a value that indicates whether the OracleParameterCollection is read-only. |
| IsSynchronized | Gets a value that indicates whether the OracleParameterCollection is thread-safe. |
| SyncRoot | Gets the object used to synchronize access to the OracleParameterCollection. |
OracleTrace Class
The OracleTrace class is created by the application to debug problems during development. Setting the properties in the OracleTrace class overrides the settings of the environment variables. See Tracing Method Calls for more information. For your final application, be sure to remove references to the OracleTrace class.
The following code fragment creates an OracleTrace object named MyTrace.txt. All subsequent calls to the data provider will be traced to that file.
OracleTrace.TraceFile="C:\MyTrace.txt";
OracleTrace.RecreateTrace = 1;
OracleTrace.EnableTrace = 1;
The following table lists the public properties for the OracleTrace class.
Public Properties of the OracleTrace Class
| Property | Description |
| EnableTrace | When set to 1 or higher, enables tracing. When set to 0 (the initial default), tracing is disabled. |
| RecreateTrace | When set to 1, the trace file is re-created each time the application restarts. When set to 0 (the initial default), the trace file is appended. |
| TraceFile | Specifies the path and name of the trace file. The initial default is an empty string. If the trace file does not exist, the data provider creates it. |
| Note: Setting EnableTrace starts the tracing process. Therefore, you must define the property values for the trace file before setting EnableTrace. Once the trace processing starts, the values of TraceFile and RecreateTrace cannot be changed. | |
OracleTransaction Class
The OracleTransaction class has no provider-specific properties or methods. For a description of the properties and methods supported, refer to the online help and the Microsoft .NET Framework SDK documentation.