Beginner |
|
Joined: Fri Nov 11, 2005 1:04 pm Posts: 22
|
I'm using the Nullable DateTime in my business objects (exposed as a standard DateTime object on the property because VB doesn't understand operator overloading using access set to member). When the property is accessed "null" gets converted to DateTime.minValue and vice versa.
For some strange reason an exception is thrown when I use the NullableDateTime (as opposed to passing a constant DateTime value and using that to represent null in my DB because DateTime.minValue causes an ADO exception because it's out of range on SQL Server...go figure).
Basically, NHibernate balks when saving a new object to the DB complaining that it can't Convert DBNull to Int32...it looks like it's trying to set the identifier but can't.
I will post the mapping/code/and log later but has anyone actually seen something similar?
Like I said, I dont have this problem unless I'm using the Nullables.
|
|