When updating a list of objects in my database, I am getting a SqlDateTime overflow exception on the same object(s) every time I try to call SaveChanges. Whats strange is that if I start from a blank database, those same records are added initially without issue. It is whenever I try to update them later on that I am getting these errors.
The stack trace is as follows:
Telerik.OpenAccess.Exceptions.DataStoreException: Update failed: System.Data.Sql
Types.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00
AM and 12/31/9999 11:59:59 PM.
oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32 fieldNos, Boole
an haveNewObjects, CharBuf s, BatchControlInfo batchControl, Boolean previousIns
Row: GenericOID@1ebe2d8e RTVirtualMachine ID=79
UPDATE [VirtualMachines] SET [BootFree] = ?, [BootTotal] = ?, [DataFree] = ?, [D
ataTotal] = ?, [HostName] = ?, [IsActive] = ?, [Memory] = ?, [OsVersion] = ?, [P
rocessorTimeStamp] = ?, [ProcessorUsagePct] = ?, [UserCount] = ?, [VCpuCount] =
?, [VmName] = ? WHERE [ID] = ? AND [BootFree] = ? AND [BootTotal] = ? AND [DataF
ree] = ? AND [DataTotal] = ? AND [HostName] = ? AND [IsActive] = ? AND [Memory]
= ? AND [OsVersion] = ? AND [ProcessorTimeStamp] = ? AND [ProcessorUsagePct] = ?
AND [UserCount] = ? AND [VCpuCount] = ? AND [VmName] = ?
Params: [@p0=0 @p1=0 @p2=0 @p3=0 @p4=
@p5=1 @p6=11999 @p7=2008 @p8=
0001-01-01T00:00:00.0000000 @p9=0 @p10=24 @p11=5 @p12=
@p15=0 @p16=0 @p17=0 @p18=
@p19=1 @p20=11999.0000000000 @p21=2008 @
p22=2015-12-01T12:58:35.5300000 @p23=0 @p24=25 @p25=5 @p26=
ta.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:
00:00 AM and 12/31/9999 11:59:59 PM.
Usually when I got an exception, the parameters in the stack trace would look normal, showing @p1, @p2, etc etc but for this particular case they are all showing as question marks in the stack trace and I am not sure why or if it has anything to do with the error I am getting here.
The parameter in question is @p22, which as you can see is a DateTime that is well within the limits of the SqlDateTime, unless I am reading that wrong.
What else could cause this?