开发者

Using sql date data type and EF4

I have a table w/ a sql date data type. When I look at the EDM markup, the st开发者_开发问答orage 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!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜