Using int.MinValue generating OverflowException in SELECT

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
pari
Posts: 17
Joined: Thu 27 Nov 2008 12:33

Using int.MinValue generating OverflowException in SELECT

Post by pari » Thu 15 Jan 2009 11:07

Hi,
this code generated System.OverflowException {"Negace minimální hodnoty čísla ve formátu dvojkového doplňku je neplatná."}

Code: Select all

// Create table:  create table pari_test (id int);

OracleConnection connection = new OracleConnection(
"server=albert;sid=albert;direct=true;uid=pollution;pwd=...");

OracleDataReader myReader = null;

OracleCommand command = new OracleCommand("SELECT id FROM pari_test WHERE id=:id", connection);
command.Parameters.AddWithValue("id", int.MinValue); //+1 is OK

try
{
    connection.Open();
    
    myReader = command.ExecuteReader(); //this code generated exception

    if (myReader.Read())
    {
        int result = myReader.GetInt32(0);
        Console.WriteLine("result: {0}", result);
    }

}
catch (Exception ex)
{
    Console.WriteLine("Error: {0}", ex.Message);
}
finally
{
    if (myReader != null)
        myReader.Close();

    command.Dispose();
}

I have:

Oracle server: 10.2.0.1.0

Microsoft Visual Studio 2008, Version 9.0.30729.1 SP
Microsoft .NET Framework, Version 3.5 SP1
Installed Edition: Professional

Microsoft Visual C# 2008 91605-270-4865775-60302
Microsoft Visual C# 2008

Core Lab OraDeveloper Tools 2.55
Copyright 2004 - 2008 Core Lab. All rights reserved.

Devart dotConnect for Oracle 5.0.12.0

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB944899) KB944899
For more information, visit http://support.microsoft.com/kb/944899.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB945282) KB945282
For more information, visit http://support.microsoft.com/kb/945282.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946040) KB946040
For more information, visit http://support.microsoft.com/kb/946040.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946308) KB946308
For more information, visit http://support.microsoft.com/kb/946308.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946344) KB946344
For more information, visit http://support.microsoft.com/kb/946344.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946581) KB946581
For more information, visit http://support.microsoft.com/kb/946581.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947171) KB947171
For more information, visit http://support.microsoft.com/kb/947171.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947173) KB947173
For more information, visit http://support.microsoft.com/kb/947173.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947180) KB947180
For more information, visit http://support.microsoft.com/kb/947180.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947540) KB947540
For more information, visit http://support.microsoft.com/kb/947540.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947789) KB947789
For more information, visit http://support.microsoft.com/kb/947789.

Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB948127) KB948127
For more information, visit http://support.microsoft.com/kb/948127.

Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1 (KB945140) KB945140
For more information, visit http://support.microsoft.com/kb/945140.

Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1 (KB947888) KB947888
For more information, visit http://support.microsoft.com/kb/947888.

Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1 (KB948484) KB948484
For more information, visit http://support.microsoft.com/kb/948484.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 15 Jan 2009 13:45

Thank you for the report. The problem is fixed. Look forward to the build of dotConnect for Oracle that will be available in several weeks.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 20 Feb 2009 14:32

The new build (5.00.22) of dotConnect for Oracle is available now.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=14185

Post Reply