I have an MVC app using Entity Framework and a SQL Server 2008 database. I used the EF wizard to generate my data model.
I have a SQL Server table with a standard DateTime
column. The EF model is using System.DateTime
.
But when I try to insert a new record into this table from my application, without specifying a value for this DateTime column, I get the error:
The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
I Googled a bit and found that people are editing the edmx and changing the ProviderManifestToken
. Ovbiously that will be overwritten, so is there a more permanent fix or way to fix this?