Tuesday, October 18, 2011

"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."

Today, I come across with a situation. I am writing a WCF service which uses LINQ to talk to database tables for DML operations.

One of the table column is of DateTime format. I mapped this with System.DateTime in Csharp. When I ran the WCF service and tried to perform insert operation, it throws following error:

"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."

I found a fix at http://geekswithblogs.net/AzamSharp/archive/2008/01/10/118446.aspx

It worked great.