您的位置:首页 > 产品设计 > UI/UE

[entity framework ] The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

2013-01-14 16:35 691 查看
One of the common error people face, when they use Entity Framework, is the exception "The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value." thrown. This occurs when the entity associated with the table being saved has a mandatory datetime field and you do not set it with some value. The default datetime object is created with a value of 01/01/1000 and will be used in place of null. This will be moved into the datetime field which can hold date value 1753-01-01 00:00:00 and not less than this leads to out-of-range exception. This error can be resolved by either making the datetime field to accept null or by initializing the field with a value.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐