Help with Nullable, Default and Single/Double
Posted: Fri 05 Sep 2014 15:38
Hi:
I have a database that has a column of type FLOAT that accepts nulls. When mapping this table with Entity Developer (stand alone or VS2013 embedded) I'm getting trouble at runtime, more preciesly it complains about:
Actual type: Single
Expected type: System.Double
I can resolve the problem by setting the column property to Nullable=False, this now leads me to my questions:
1. If I set Nullable=False on a column that does support nulls in the database, will the ORM convert nulls to the Default Value?
2. When setting Default Value on a DATETIME column, what format should the date be? In other words, is that evaluated at compile time or runtime, as the localizations may be different. This also goes for numeric value formats (decimal points etc.)
Thanks,
Martin.
I have a database that has a column of type FLOAT that accepts nulls. When mapping this table with Entity Developer (stand alone or VS2013 embedded) I'm getting trouble at runtime, more preciesly it complains about:
Actual type: Single
Expected type: System.Double
I can resolve the problem by setting the column property to Nullable=False, this now leads me to my questions:
1. If I set Nullable=False on a column that does support nulls in the database, will the ORM convert nulls to the Default Value?
2. When setting Default Value on a DATETIME column, what format should the date be? In other words, is that evaluated at compile time or runtime, as the localizations may be different. This also goes for numeric value formats (decimal points etc.)
Thanks,
Martin.