From: <ait...@gm...> - 2003-06-05 18:49:49
|
Hi, A System.OverflowException raises when I try to populate a FbDataSet using select commands that include NUMERIC type columns. I've tracing the FirebirdNetProvider sources and the exception is raised by the following piece of code: // ".\NGDS\GDS.cs", line 2074 (1.0 Final), 2515 (1.1 Alpha) // ... } else if (dtype == GdsCodes.SQL_LONG) { blr[n++] = 8; // blr_long blr[n++] = (byte) xsqlda.sqlvar[i].sqlscale; // ... xsqlda.sqlvar[i].sqlscale returns a value of -2 in my test ... // My test code ... string mySelectCommandText = "select HONORARIOS from FACTURAS"; using (FbDataAdapter myDataAdapter = new FbDataAdapter(mySelectCommandText, this.Database.Connection)) { using (System.Data.DataSet myDataSet = new System.Data.DataSet()) { FbTransaction myTransaction = this.Database.Connection.BeginTransaction(); try { myDataAdapter.SelectCommand.Transaction = myTransaction; myDataAdapter.Fill(myDataSet); myTransaction.Commit(); } finally { if (!myTransaction.IsUpdated) myTransaction.Rollback(); } } // FACTURAS table create table "FACTURAS" ( "ID" double precision not null primary key, "SINIESTRO" double precision not null, "FECHA" date not null, "GASTOS_DIETAS" numeric(9, 2) not null, "GASTOS_FOTOS_IMPORTE" numeric(9, 2) not null, "GASTOS_FOTOS_NUMERO" smallint not null, "GASTOS_KILOMETROS_IMPORTE" numeric(9, 2) not null, "GASTOS_KILOMETROS_NUMERO" numeric(9, 2) not null, "GASTOS_OTROS" numeric(9, 2) not null, "GASTOS_PEAJES" numeric(9, 2) not null, "HONORARIOS" numeric(9, 2) not null, "NUMERO_FACTURA" integer not null, "PORCENTAJE_IVA" numeric(4, 2) not null, "PORCENTAJE_RETENCION" numeric(4, 2) not null, /* campos calculados */ "GASTOS" computed by (GASTOS_DIETAS + GASTOS_FOTOS_IMPORTE + GASTOS_KILOMETROS_IMPORTE + GASTOS_OTROS + GASTOS_PEAJES), "SUBTOTAL_1" computed by (HONORARIOS + GASTOS), "IVA" computed by ((PORCENTAJE_IVA / 100) * SUBTOTAL_1), "SUBTOTAL_2" computed by (SUBTOTAL_1 + IVA), "RETENCION" computed by ((PORCENTAJE_RETENCION / 100) * SUBTOTAL_2), "TOTAL" computed by (SUBTOTAL_2 - RETENCION), /* claves externas */ foreign key (SINIESTRO) references SINIESTROS (ID) on delete cascade on update cascade ); Test code works fine if I declare "HONORARIOS" field as REAL, for example. Any clue about this? Visual Studio 2002 .NET Framework 1.0.3705 FirebirdNetProvider 1.0 Final (source code) Firebird 1.02 Thanks in advance, Aitor. |