dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleNumberMappingCollection Class / Add Method / Add(OracleNumberType,Int32,Type) Method
The Oracle number type being mapped.
The precision of Oracle number for which it should be mapped to the specified .NET type.
The .NET type to which the Oracle number is mapped.
Example

In This Topic
    Add(OracleNumberType,Int32,Type) Method
    In This Topic
    Creates a new instance of the OracleNumberMapping class and adds it to the collection.
    Syntax
    'Declaration
     
    Public Overloads Function Add( _
       ByVal numberType As OracleNumberType, _
       ByVal precision As Integer, _
       ByVal valueType As Type _
    ) As OracleNumberMapping

    Parameters

    numberType
    The Oracle number type being mapped.
    precision
    The precision of Oracle number for which it should be mapped to the specified .NET type.
    valueType
    The .NET type to which the Oracle number is mapped.

    Return Value

    The created OracleNumberMapping object.
    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