I have an exampleDate column which is DATE in the table.(Not DATETIME)
I have an vb.net property like this...
Public Property myDate() As Date?
Get
Return _myDate
End Get
Set(ByVal Value As Date?)
_myDate = Value
End Set
End Property
I try to insert/update values like this...
UPDATE myTable SET exampleDate = @myDate
If myDto.myDate Is Nothing Then
MyCommand.Parameters.AddWithValue("myDate", System.DBNull.Value)
Else
MyCommand.Parameters.AddWithValue("myDate", myDto.myDate)
End If
I know the DATE type in mssql2012 has range like that 0001-01-01 / 9999-12-31. However everytime I try to insert or update value before the 1/1/1753 , I get this error... How can I fix this problem ?
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.