Question

I have a table w/ a sql date data type. When I look at the EDM markup, the storage element reflects this. The conceptual entity has a data type of DateTime (there doesn't appear to be a Date data type). When I call save changes and have a DateTime instance associated w/ the entity I want to persist, I get the following error:

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated.

How can I use the date data type in my schema and have EF behave? Thanks!

Was it helpful?

Solution

Sounds like your SQL date column is non-nullable, but you haven't initialized the date on your entity before saving?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top