Click here to Skip to main content
15,850,753 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to set null value to date time
DateTime dt =null;

1 solution

Change the variable declaration to DateTime? dt =null;
Share this answer
dhiraj mane 27-Sep-13 7:03am    
got error
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
ArunRajendra 27-Sep-13 7:47am    
Did you get this error in the database?

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