Page 1 of 1

DataReader.GetValue -> Unhandled Exception: System.ArgumentOutOfRangeException

Posted: Mon 05 Oct 2020 12:57
by hansjoergp
I have an project where I get always the following exception:

Code: Select all

Unhandled Exception: System.ArgumentOutOfRangeException: Decimal's scale value must be between 0 and 28, inclusive.
Parameter name: scale
   at System.Decimal..ctor(Int32 lo, Int32 mid, Int32 hi, Boolean isNegative, Byte scale)
   at Devart.Data.Oracle.OracleNumberUtils.ToDecimal(Byte[] , Int32 )
   at Devart.Data.Oracle.OracleBufferConverter.GetValue(Byte[] , Int32 , Int32 )
   at Devart.Data.Oracle.OracleDataReader(Int32 )
   at Devart.Data.Oracle.OracleDataReader.GetValue(Int32 i)
Now I have made an test project and it seems that the problem appears only if I make an call to command.Prepare() otherwhise everything works fine

Code: Select all

OracleCommand command = connection.CreateCommand("SELECT TODONEUENTWICKLUNG, TECNOTIZ, TECNOTIZ2, KNDNOTIZ, KNDNOTIZIT, KNDNOTIZEN, KNDNOTIZUEB, PROGNOTIZ, UESTZNOTIZ, FAKTNOTIZ, VERSIONSLISTE, TODOAUFRECHANFUEHREN, TODOAUSLIEFERUNG, TODOBEMERKUNG FROM ADO_TODO_TEST WHERE  todokode = 127986",
                                                                CommandType.Text);

                command.Prepare();

                var reader = command.ExecuteReader(CommandBehavior.SingleResult);
                reader.Read();
                
                reader.Dispose();

                reader = command.ExecuteReader(CommandBehavior.SingleResult);
                reader.Read();
                for (var i = 0; i < reader.FieldCount; i++)
                {
                    var val = reader.GetValue(i);
                }
I use the newest version.
I have send you an test project with the contact formular. There exists an script folder with the table and data definition

Re: DataReader.GetValue -> Unhandled Exception: System.ArgumentOutOfRangeException

Posted: Fri 09 Oct 2020 20:19
by Shalex
Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

Re: DataReader.GetValue -> Unhandled Exception: System.ArgumentOutOfRangeException

Posted: Thu 17 Dec 2020 22:19
by Shalex
The bug with throwing System.ArgumentOutOfRangeException, when OracleCommand.Prepare() has been called before and reader is reused with another query, in the Direct mode is fixed in v9.14.1160: viewtopic.php?f=1&t=44320.