Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have faced a problem when I want to save DateTime.Now into my database table.
My code is as below:-
C#
cmd.Parameters.AddWithValue("@UpdateDated",DateTime.Now);


However when I run the code, it show the error
"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
Posted
Comments
Can you show the whole function code?

1 solution

 
Share this answer
 
v2
Comments
Shahin Khorshidnia 1-Jul-13 13:33pm    
+5

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