dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleConnectionStringBuilder Class / NumberMappings Property
Example

NumberMappings Property (OracleConnectionStringBuilder)
Gets or sets the collection of number mappings used for this connection.
Syntax
'Declaration
 
Public Property NumberMappings As OracleNumberMappingCollection
 

Property Value

A OracleNumberMappingCollection object representing the number mappings.
Remarks

Allows you to override default number mapping rules for the connection. Default value is an empty collection, which means to use default rules. Default rules are the following

Precision Scale .NET type
1 - 9 0 System.Int32
10 - 15 0 System.Double
> 15 0 System.Decimal
1 - 15 > 0 System.Double
> 15 > 0 System.Decimal
Example
This sample demonstrates how to override default number mapping rules.
OracleConnection oracleConnection = new OracleConnection();

// Map NUMBER(10)..NUMBER(18)  to Int64
oracleConnection.NumberMappings.Add(OracleNumberType.Integer, 10, 18, typeof(Int64)); 

// Map NUMBER(1)  to Boolean
oracleConnection.NumberMappings.Add(OracleNumberType.Integer, 1, typeof(bool));
Dim oracleConnection as New OracleConnection

' Map NUMBER(10)..NUMBER(18)  to Int64
oracleConnection.NumberMappings.Add(OracleNumberType.Integer, 10, 18, GetType(Int64))

' Map NUMBER(1)  to Boolean
oracleConnection.NumberMappings.Add(OracleNumberType.Integer, 1, GetType(Boolean))
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also