Click here to Skip to main content
15,887,386 members
Please Sign up or sign in to vote.
5.00/5 (1 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

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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900