I know there are a ton of posts about this issue but none of them seem to solve my problem.
Here\'s the scenario:
I have a CreateDate Date
I know this is an old question but maybe this may help someone:
The problem may be a bug that causes StoreGeneratedPattern
in the Conceptual section (CSDL) of the .edmx file to be out of sync with the StoreGeneratedPattern
in the Storage section (SSDL). The GetDate()
default is never called because - unless you assign the date from your client-side code - the default value of DateTime.MinValue
is used.
The good news is, it's fixed. Look for KB2561001: http://archive.msdn.microsoft.com/KB2561001. I don't know if this is fixed in the subsequent EF 4.3 release or you still have to apply the hotfix.
Have you tried setting the StoreGeneratedPattern attribute to 'Computed'. Failing that, as a last resort, try changing the column's datatype to datetime2
.
[The problem arises because the .NET DateTime.MinValue
equals 0001-1-1 but Sql Server DateTime
covers 1753-1-1 through 9999-12-31]