Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using two datetime field in my database. For some condition I want to save a null values into that column. Previously I have stored the dateandtime after editing I want to save the null values into that field. I have tried putting "null","string.Empty","Sqltype.Datetime.null","dbnull" but it throws an object reference error. Can anyone help me to solve this problem

Thanks in advance
Posted
Comments
Mahendra.p25 27-Aug-11 1:27am    
Post Your Code
Herman<T>.Instance 27-Aug-11 1:51am    
Have you tried DBNull.Value?

1 solution

CSS
using System.Data.SqlTypes;


  System.Data.SqlTypes.SqlDateTime getDate;
  getDate =  SqlDateTime.Null;
 
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