Corrupt data - strange behaviour

Hello,

I'm using Aspose to process multi-sheet Excel workbook containing decimal data. I extract datas and save them into decimal (15, 9) field in an SqlServer database.

Today a problem happened with processing a cell value on a file. Here are the infos i log into the eventlog when the exception is thrown :

Error :System.FormatException: Input string was not in a correct format.
at System.Number.ParseDecimal(String s, NumberStyles style, NumberFormatInfo info)
Value Infos :
Array Title :Expected_CC_N, Cell : C30, Cell value : 6JGrOJXtkVF

I thought the cell C30 was was containing "6JGrOJXtkVF" but it has nothing to do with that, the cell C30 contains a formula (=B30+1) and the result is "25620202". Moreover all the sheets only contains numeric values. To test it further I processed the same file several times but the error not happens every time and the cell position causing the error is changing every time...

Here is the code i use to extract the value from a cell :


if(cCommon.IsNumeric(ws.Cells[worksheetRowIndex, worksheetColumnIndex].StringValue))

{

cellValue = Convert.ToDecimal(ws.Cells[worksheetRowIndex, worksheetColumnIndex].StringValue) ;

string insertValue = "INSERT INTO TB_VALUE (ID_LINEARRAY, ID_COLUMNARRAY, NUMVALUE, VALUEDATE, STATUS, CREATIONDATE) VALUES ({0}, {1}, {2}, dbo.DateTimeToDateOnly({3}), {4}, dbo.DateTimeToDateOnly({5}))" ;

cData.ExecuteNonSQL(insertValue, trans, drRow["Id_LineArray"], drColumn["ID_ColumnArray"], cellValue, dateToUpdate, ValueStatusType.Active, DateTime.Now) ;

}





Any suggestion is welcome, i'm really stuck with this bug.

Best regards

Faessler Gilles




Do you use the trial version? Please check Licensing
for reference.

I guess the only problem is that you’re (still) using the evaluation version ; this places random data at random positions, which sometimes overwrites important formulas and data.

Luc