Hi,
I use WPF databinding to entities. Really important feature of my application is localization (GUI and all messages etc.). Language and culture can be changed in runtime. I use custom validation described here:
http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=15343
If I bind decimal value to entity field which is decimal(18,6) in my database (SQL server 2008 ) and write more than 18 digits I receive the following exception.
The precision of value '123456789012345676.1' is larger than the precision of the field: '18' and will cause an overflow in the database.
Parameter name: DivisibleBy
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.ValidateValue(IEntityField2 fieldToValidate, Object& value, Int32 fieldIndex)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.SetValue(Int32 fieldIndex, Object value, Boolean performDesyncForFKFields)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.SetValue(Int32 fieldIndex, Object value)
at MyProject.DataAccess.Core.EntityClasses.CommonEntityBase.SetValue(Int32 fieldIndex, Object value) in D:\Programming\MyProject_Trunk\src\DataAccess\MyProject.DataAccess.Core\MyProjectSpecific\CommonEntityBase.cs:line 690
at MyProject.DataAccess.Core.EntityClasses.InputFormatDecimalEntity.set_DivisibleBy(Nullable`1 value) in D:\Programming\ MyProject _Trunk\src\DataAccess\MyProject.DataAccess.Core\DatabaseGeneric\EntityClasses\InputFormatDecimalEntity.cs:line 696
The behaviour is correct and error message is correctly set to this message. But how to translate this message? Is it possible to provide custom messages for all exceptions thrown by ORM and change them during runtime?
Can you provide the list of possible exceptions during setting entity property?
Application specification:
SQLServer 2008
WPF 4.0, DevExpress Controls 10.2.4
ORM version 2.6.10.0225
Regards,
David