Page 1 of 1

How to handel an 'Integer not-null field'

Posted: Mon 17 Aug 2009 09:44
by afva
Hello,

I have a table with a colum 'Total' of type: Number(12) not NULL.
I use devart LINQ-to_slq to create a class.

How do you handle this in the interface when the field has a value NULL?
I don't want to show the default text 'Input string was not in the correct format', but I cannot 'catch' this value to use my own validation-rules because the interface (onChange..) does'n allow a null-value)

When I add a new record it shows a '0' in the field and I prefer to show an empty field.

The solution I came up with, is to make the column a NULL-column when creating the class. In my validation-rules I can catch a null-value,
but that doens't feel good.
Is ther another solution?

Thanks in advance.
(I use an Oracle database with WPF v2008)

Posted: Mon 17 Aug 2009 10:57
by AndreyR
The solution you've described is appropriate in case you have implemented validation rules transforming null values
into some default value or showing proper error message depending on the logic of your application.

Other option

Posted: Mon 17 Aug 2009 11:22
by afva
Hello AndreyR,
Thanks for the response.

I actually don/t want to use this solution. I am in a testing envorionment and this means that everytime I want to create the new linq-to-sql class, I have to look for columns of type integer NOT NULL, and make the changes manually.
I am trying to avoid this.

Is there another solution?

Posted: Mon 17 Aug 2009 12:28
by AndreyR
Please send me (support * devart * com) a test project illustrating the scenario you are
implementing, maybe I will be able to give you a better piece of advice.

Posted: Mon 17 Aug 2009 13:58
by afva
Hello Andrey,

I just send you a document and a .rar file.
Thanks