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.
Help with Nullable, Default and Single/Double
Re: Help with Nullable, Default and Single/Double
Please specify the following details:
- the version of LinqConnect;
- the DBMS you are working with, is it MySQL? its version;
- set the Default Value for the "datetime" property in the model, for example: CURRENT_TIMESTAMP, or 08.09.2014, or 08/09/2014;
- set the Auto Generated Value to True for this property in the Property Editor.
In first case, the value for the "datetime" field will be set on the client side and, in the second case, the value for this field will be set on the server side.
- the version of LinqConnect;
- the DBMS you are working with, is it MySQL? its version;
Please send us the model you are working with and the DDL script for the database table. Also please specify the code with which this error occurs.Actual type: Single
Expected type: System.Double
Yes.If I set Nullable=False on a column that does support nulls in the database, will the ORM convert nulls to the Default Value?
There are two possible ways:When setting Default Value on a DATETIME column, what format should the date be
- set the Default Value for the "datetime" property in the model, for example: CURRENT_TIMESTAMP, or 08.09.2014, or 08/09/2014;
- set the Auto Generated Value to True for this property in the Property Editor.
In first case, the value for the "datetime" field will be set on the client side and, in the second case, the value for this field will be set on the server side.
Re: Help with Nullable, Default and Single/Double
Hi:
I am using LinqConnect 4.4.557 connected to SQL Server 2008 R2.
When I run into the error again I will send the requested information to you. It has happened on three occasions on different databases so it should not take long to reproduce.
Regards,
Martin.
I am using LinqConnect 4.4.557 connected to SQL Server 2008 R2.
When I run into the error again I will send the requested information to you. It has happened on three occasions on different databases so it should not take long to reproduce.
Regards,
Martin.
Re: Help with Nullable, Default and Single/Double
We are looking forward to your reply with the additional information.When I run into the error again I will send the requested information to you.