The value specified will cause an overflow error in the database.

Posts   
 
    
Posts: 35
Joined: 07-Jun-2016
# Posted on: 12-Jun-2020 23:49:15   

LLBLGen version 2.6

we recently increased a column from 5 characters to 20 and we get the following error when trying to insert a 6 character value:

The value specified will cause an overflow error in the database. Value length: 6. Column max. length: 5 Parameter name: Htank01.

After regenerating I see this metadata on that property in our Domain project:

    ''' <summary>The Htank01 property of the Entity TblGrossmanOrotrn<br/><br/>
    ''' </summary>
    ''' <remarks>
    ''' Mapped on table field: "tblGrossman_Orotrn"."HTank01"<br/>
    ''' Table field type characteristics (type, precision, scale, length): Char, 0, 0, **20**<br/>
    ''' Table field behavior characteristics (is nullable, is PK, is identity): True, False, False
    ''' </remarks>

It clearly shows that the length is now 20 but our code is still erroring.

Any assistance?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Jun-2020 07:15:24   

If you get the error before re-generating: the error makes sense, as the framework sees the 5 length. If you re-generated and still get the error, please double check that you are using the correct generated code.

If it persists, please post the exception message and stack trace. Also your LLBLGen runtime library version (https://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7717) .

David Elizondo | LLBLGen Support Team
Posts: 35
Joined: 07-Jun-2016
# Posted on: 15-Jun-2020 17:21:22   

Version is 2.6 Final.

This was AFTER regenerating.

I got the error to go away for some fields by unmapping the field, regenerating, then remapping the field and regenerating again.

I'm still having an issue with one field not recognizing the field size increase from 5 to 20.

Posts: 35
Joined: 07-Jun-2016
# Posted on: 15-Jun-2020 20:26:45   

Finally resolved this by deleting the domain project entirely and regenerating from scratch.

Not sure why LLBLGen was refusing to accept the new fieldsize confused but this is resolved now.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 16-Jun-2020 07:54:50   

It might have been because a file was locked/readonly and therefore not overwritten. Although 2.6 is 12 years old it did produce a log afterwards where it would describe these events. But anyway, that's for next time, glad it's solved now simple_smile

Frans Bouma | Lead developer LLBLGen Pro