Loss in the decimal part of a number after upgrading to v.2.5

Posts   
 
    
nefise
User
Posts: 22
Joined: 01-Dec-2006
# Posted on: 05-Feb-2008 14:30:29   

Oracle 10g c#.NET 2005 v2.0-v2.5 Adapter

when we upgrade to v2.5 from v2.0 the scale part of the numbers are lost during the execution of the program. For example; altough the value "12.456" is written into the cell from the user interface or assigned in the code. The value cannot be assigned to the entity collection as "12.456" , it is changed to "12". In Our database design; the scale part of the number types are not defined. But this was not a problem for v2.0. Changing the definitions of all numeric values is really hard for us. What else can we do? Why is this a problem for 2.5 even tough it was not a problem for 2.0.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Feb-2008 16:53:56   

Hi nefise,

This is copied from the LLBLGenPro Help - What's new/changed in LLBLGen Pro v2.5?

Build-in precision/scale checks for numeric values. These checks are performed automatically (unless you turn off automatic checking) to prevent overflows in the database. For example if you define a field of type decimal in your database, with precision 10 and scale 2, and you try to store a value 1234567.123 into this field, you'll get an exception that the value will cause an overflow as the precision/scale of the value exceed the precision and scale of the field. Due to these automatic checks, developers don't have to write validators for every numeric field to see if there is a possible overflow. BREAKING CHANGE: this feature can break existing applications at runtime because suddenly values like 10.500 are rejected while they were acceptable in previous versions. To overcome this, a global static (shared) property on the EntityBase(2) classes, called **ScaleOverflowCorrectionActionToUse **is added which accepts one of the 3 different values (None ( throw exception on scale overflow), Truncate (default, which truncates the fraction to fit the scale) or Round (which rounds the fraction using Math.Round)). This property is also settable using a config file setting by adding a line to appSettings in the config file of your application with as key **scaleOverflowCorrectionActionToUse **and as value 0, 1, or 2, which represent None, Truncate or Round.

Also please read: LLBLGenPro Help - Using the generated code - Validation per field or per entity - Built-in validation logic..

Please let us know if it works ok wink

David Elizondo | LLBLGen Support Team
nefise
User
Posts: 22
Joined: 01-Dec-2006
# Posted on: 11-Feb-2008 16:32:34   

we add the line <add key="buildInValidationBypassMode" value="1"/> to the app.config file of our project and it is ok now. Thanks for your help.