Click here to Skip to main content
15,910,277 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I facing the error of

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


i take field DOB with datatype of datetime and at the time of submitting data its return error which i mention above
how can i solve it?
Posted
Comments
Raje_ 9-Jul-12 4:32am    
your error says that you should enter the date between 1/1/1753 12:00:00 AM to 12/31/9999 11:59:59 PM;
probably you are entering the date that is not in between the given range.
Sanjay Kunjam 9-Jul-12 4:35am    
Hi,
Put some code portion while you enter your question for more clarification.
Vani Kulkarni 9-Jul-12 4:35am    
What is the input date you are submitting?

Please validate your date input control. Now its trying to input a value not in the specified range. Also allow null to that column in database.

Regards
Sebastian
 
Share this answer
 
Hi,

1. Make sure your machine clock is not in 15th century ;-)
2. Recreate your model.(In case of MVC)
3. It your table has default value you don't have to set it in code.
4. Consider using GETUTCDATE() instead of GETDATE()
5. Make sure there are no other DateTime fields without default values.

All the best.
--Amit
 
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