Last post Feb 01, 2017 03:08 AM by Cathy Zou
Jan 28, 2017 10:16 PM|JAYHAWKER|LINK
if I use DateTime dt = DateTime.MinValue.Date; in C# as a default minimum value, I get the error "
what is the best way of handling this?
Jan 28, 2017 11:54 PM|RichardY|LINK
Use a Nullable DateTime and make the Sql server column nullable.
Edit: Actually MikesDotNetting has a couple of other options: 1) change the DataBase type to DateTime2 and 2) Provide your own default value.
Feb 01, 2017 03:08 AM|Cathy Zou|LINK
That error means you are trying to import data into a column of SQL Server data type "datetime", but at least one data from the source exceed the allowed range of dates between year 1753 and 1999.
In other words, The valid SQL Server datetime range is between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. If you send in a datetime outside of this range, you will get the exception you mention.