G
Guest
I've got a database application that uses the DateTimePicker to display/edit a person's birthdate. I'd like to use the .Checked property to determine if I want to write the date to the DB, but the behavior isn't what I expect. It seems that if I check or uncheck the DTP checkbox, the .Checked property doesn't always reflect that status.
Ideally, when the box is checked and a date has been selected, I want to write the date to the DB. If the DTP is not checked, I want to write a NULL to the database. I'm checking the .checked property before I write to the DB and I find that it's not always reflective of the current state of the DTP checkbox.
If (dtpBirth.Checked) Then
<write the date to the db>
Else
<write null to the db>
End If
Any ideas as to what I'm doing wrong? (Win XP Pro, .NET1.1, VB, FYI)
Thanks!
Mike
Ideally, when the box is checked and a date has been selected, I want to write the date to the DB. If the DTP is not checked, I want to write a NULL to the database. I'm checking the .checked property before I write to the DB and I find that it's not always reflective of the current state of the DTP checkbox.
If (dtpBirth.Checked) Then
<write the date to the db>
Else
<write null to the db>
End If
Any ideas as to what I'm doing wrong? (Win XP Pro, .NET1.1, VB, FYI)
Thanks!
Mike