views:

36

answers:

1

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.

+1  A: 

Sorry, I was having a blonde moment! The field in the database table didn't have a default value set!

Dan
+1 for having the balls to admit when you've been a numpty, and letting other readers see what the problem was.
Martin Milan