SqlDateTime overflow on INSERT when date is correct using a Linq to SQL DataContext
Posted
by Jan Hoefnagels
on Stack Overflow
See other posts from Stack Overflow
or by Jan Hoefnagels
Published on 2010-03-23T11:35:52Z
Indexed on
2010/03/23
11:43 UTC
Read the original article
Hit count: 640
Dear Linq experts,
I get an SqlDateTime overflow error (Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.) when doing an INSERT using an Linq DataContext connected to SQL Server database when I do the SubmitChanges().
When I use the debugger the date value is correct. Even if I temporary update the code to set the date value to DateTime.Now it will not do the insert.
Did anybody found a work-around for this behaviour? Maybe there is a way to check what SQL the datacontext submits to the database.
© Stack Overflow or respective owner