SqlDateTime Overflow. Must be between 1/1/1753 and 12/31/9999

In current application I have a call to Stored Procedure which updates a table which has some DATETIME column as well. I was testing for various combination and as per test cases all was as expected, except one scenario where my orchestration remained in Started mode itself.  

On seeing the Tracked Message Events, found that message has been sent to SP but no response is received (that's why Orchestration is in started mode).

So, next was to check why there was no response from SP and it was the below errors which made SP to break

Event 5754

Event 10034

Why it happened

As the error says, the date passed against the datetime parameter was out of accepted range. I had set default date to 0001-01-01 but the range starts from 1753-01-01

Invalid date range

What to do

I changed the default date to  1900-01-01 00:00:00.000 and all worked fine.

One more thing to do is, to have exception block for SQL exception :) 

If you have questions or suggestions, feel free to do in comments section below !!!

Do share if you find this helpful .......
                          Knowledge Sharing is Caring !!!!!!

Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post