NULL datetime

D

Dean L. Howen

Dear friends,
Could you help me to solve the problem:
How can we set/get NULL values of datetime in DatetimePicker ?
I design a form using DateTimePicker to input/output date value, but the
date could be
NULL
Thank you.
 
J

John Baro

Since DateTime is a valuetype you cannot set it to null.
If you need to set it to null you can on your form have a Not Applicable
checkbox and disable the datetime picker when checked or define a date that
will be treated as null. ie 1/1/1.
Or you could create an object wrapping DateTime which will cater for null.
And/Or you might be able to subclass the datetime picker and add a null
button or some such.
HTH
JB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top