How to set date type to null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a object which has a date type property, but if I not assign any value to it, it always display "#12:00:00 AM#" or "1/1/0001". How can I leave it as empty or null/dbnull value

Thanks in advance
ddt
 
Hi, ddt

as DateTime is value type, you can't use null with it. However, you can
always check if it is equal to DateTime.MinValue and act accordingly. It's
not that much difference with checking for null, right?

HTH
Alex

ddt said:
Hi,
I have a object which has a date type property, but if I not assign any
value to it, it always display "#12:00:00 AM#" or "1/1/0001". How can I
leave it as empty or null/dbnull value?
 
Back
Top