Null data value for a datetimepicker would get you an error?

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

Guest

I have binded the dtp control to the following. Most of these fields are
still blank for the dtp. Is this why I'm getting an error at appl run time
about "Object can't be cast from DBNull to other." error? Is there anyway
around this?

Thanks, Alpha
 
Yeah, the DateTimePicker can't deal with null values too well.

Your options are to either extend the existing DTP and add NULL support
yourself, or have a look around on the net for one that someone else has
already done.

Most of the solutions I've seen are to set the CustomDateFormat to blank,
and not worry about the assigned value.
 
Thank you.

Brendan Green said:
Yeah, the DateTimePicker can't deal with null values too well.

Your options are to either extend the existing DTP and add NULL support
yourself, or have a look around on the net for one that someone else has
already done.

Most of the solutions I've seen are to set the CustomDateFormat to blank,
and not worry about the assigned value.
 

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

Back
Top