Entity framework error: The conversion of a datetime2 data type to a datetime data
- by EdenMachine
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 DateTime column in my MS SQL Server database User table that is non-nullable and is automatically set using GetDate() method in "Default Value or Binding" setting.
I am able to create a User just fine with the standard EF Insert but when I try to update the user, I get this error:
The conversion of a datetime2 data
type to a datetime data type resulted
in an out-of-range value.
What is the trick to not having the EF worry about the CreateDate column for updates? I have the StoreGenerationPattern = Identity but that isn't helping.
Here are the EF properties for my Entity Property:
http://screencast.com/t/8ndQRn9N
And here is my Update method:
http://screencast.com/t/UXIzhkhR