DateTime and DateTime2Problem:Conversions from the DATETIME2 data type to the datetime data type produce an out-of-range valueReason:The model in EF has a datetime type field, and if you do not assign a value, the default is to generate a time value
SQL Server uses date to represent dates, time to represent times, and datetime and datetime2 to represent dates and times.1, the precision of the second refers to the number of decimal places used to represent 1s:The precision of the datetime data
The new date and time types in SQL Server 2008 are datetime2 and datetimeoffset.
Datetime2 data type, It is similar to the datetime type, but its precision is relatively high. It can be precise to the last 7 digits (100ns) after the decimal point.
When I execute a program written in EF 6.0, the error is as follows: Conversions from the datetime2 data type to the datetime data type produce an out-of-range value.Development environment:Visual Studio 2013. NET Framework 4.5Entity Framework
Create a sql2008 database from the entity model of ado.net. The date type is datetime,CodeSavechanges throws an exception when the date is modified. The exception information is:
An error occurred while updating entries. For more information, see
The conversion from the datetime2 data type to the datetime data type generates a value out of the range, datetime2datetime
This error occurs when you use Entity Framework to operate databases.This error is strange, in the garden saw a brother
Exception Description:Data access with EF, the default value set in the database with GETDATE () is not assigned in the program.An exception occurred.This error in Baidu before I write this article there are not many solutions, Google wait until the
1. The time format for the DateTime field type is yyyy-mm-dd HH:mm:ss.fff , 3 F, which has a time precision of 1/300 seconds, which is rounded to round to. 000,. 003, or. 007-second increments when used, with an example -All: 15.007 .2, the
The time format for the DateTime field type is Yyyy-mm-dd hh:mm:ss.fff,3 F, which is accurate to 1 milliseconds (ms), example 2014-12-0317:06:15.433.The DateTime2 field type corresponds to a time format of Yyyy-mm-dd hh:mm:ss.fffffff,7 F, which is
DateTime field type corresponds to a time format of yyyy-mm-dd HH:mm:ss.fff , 3 F, accurate to 1 ms (MS), example -- £ º15.433 .The DateTime2 field type corresponds to a time format of yyyy-mm-dd HH:mm:ss.fffffff , 7 F, accurate to 0.1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.