Joe Merlino
Posts: 4
Nickname: ooforever
Registered: Aug, 2005
|
|
Re: Short and null
|
Posted: Aug 23, 2005 6:44 PM
|
|
|
Not sure if this is what you are getting at but a short can't be null. As a public property coupled with a private class variable its initialized to 0. A way to overcome this is to have a common library or assembly that defines all primitive types null values to be say short.minvalue. When you're getting the null value from a database, set the property to that value. This of course would need to be tested by the controller or ui layer and handled accordingly in the UI. On the way back into the database the dataaccess layer would then prepare the parameter for this value and set it to the db type null for that type so that it will be represented as NULL in the database table.
|
|