Click here to Skip to main content
14,326,871 members
Rate this:
Please Sign up or sign in to vote.
See more:
HI,
When i try tu insert value from the datetimepicker then a exception of SQLDateTime Overflow occurs.The exception is
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.


Please guide how to handle this?
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

you gotta love SQL DateTime, check what is been sent to the database from your app, then check the format of the date in the database, most of the time you are sending MM/dd/yyyy while the database is expecting dd/MM/yyyy, try using collate or CONVERT for your dates, though until you see what is the app sending you will know better what to do

CONVERT(VARCHAR(10), GETDATE(), 101) 


will make your date MM/DD/YYYY
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100