[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.
相关文章推荐
- conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
- EF 6.0 The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. c#中的时间
- The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
- The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. 错误的原因及解决方案
- 海洋工作室——网站建设专家:The version of SQL Server in use does not support datatype datetime2 and the Entity Framework.
- ERROR: The version of SQL Server in use does not support datatype 'datetime2'.
- The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List
- [Javascript] A function works like 'print_r()' in PHP to print out the details of an object for JS debugging
- In a bunch of number to find out the biggest minimum value
- 类似Build Error: #513: a value of type "int" cannot be assigned to an entity of type "char *"
- keil(MDK)中出现error: #513: a value of type "int" cannot be assigned to an entity of type "char *",即函数返回值无法赋值给对应变量的错误
- keil(MDK)中出现error: #513: a value of type "int" cannot be assigned to an entity of type "char *",即函数返
- Err:The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array
- Here's an example that shows how to enumerate through the features of a selection set, returning the value of each field in the attribute table except for the geometry colum.
- ADO.NET Entity Framework: The version of SQL Server in use does not support datatype 'datetime2'
- Fast ways in R to get the first row of a data frame grouped by an identifier
- sql常犯错误之不正确的谓词运算顺序Conversion failed when converting the varchar value 'abc' to data type int
- The version of SQL Server in use does not support datatype 'datetime2'.
- HOW TO: Change the Owner of a User-Defined Data Type That Is in Use in SQL Server 2000
- lr场景异常Continuing after Error -26479: Conversion of form submission data to the target charset failed: U_TRUNCATED_CHAR_FOUND解决方法