DateTimePicker not updating dataset

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2010-05-16T09:56:14Z Indexed on 2010/05/16 10:00 UTC
Read the original article Hit count: 699

Filed under:
|
|
|

I'm binding a DateTimePicker control to my dataset (which is linked to a database). However, unless the user changes the date on that control, the dataset seems to contain null for that entry (even though the Value entry of the control isn't null). I've done a bit of googling, and there's a lot of talk about people having troubles with the DateTimePicker not supporting null values. However, I DON'T want it to support a NULL value. The column in my database table is set to "NOT NULL". It's as if the dataset isn't updating itself from the DateTimePicker control unless the user changes the date.

I've tried explicitly setting the date for the control in code (using DateTimePicker.Value = DateTime.Now). This still doesn't update the dataset side.

Thankyou for any help, Dan.

© Stack Overflow or respective owner

Related posts about c#

Related posts about databinding