'datetime2' error when using entity framework in VS 2010 .net 4.0

前端 未结 16 1244
半阙折子戏
半阙折子戏 2020-11-29 00:04

Getting this error:

System.Data.SqlClient.SqlException : The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range v

16条回答
  •  一生所求
    2020-11-29 01:03

    Entity framework handles all the dates as a Datetime2, so, if your fields in the database are Datetime, this could be a problem. We had the same problem here, and from what we found, populating all the date fields and changing the datatype, are the most commom solutions

提交回复
热议问题