Anyone know about datetimepickers?

brendalisalowe

New member
Joined
Aug 24, 2004
Messages
2
Programming Experience
1-3
I am trying to use datetimepickers on my windows form, but I cannot get it to work for the life of me. AHHH! Anyone know how? I have a NULL value in the database right now and when it is NULL, I want it to appear blank. Once someone picks a date, I then want that to be displayed. Right now I have it where it shows blank, but when I pick a new date it doesn't show it. Like it keeps it blank. Any one have any ideas? This is what I have in my Form_Load right now:

VB.NET:
If IsDBNull(dr("MailedFirst")) Then
dtpMailedFirst.Format = DateTimePickerFormat.Custom
dtpMailedFirst.CustomFormat = " "
Else
dtpMailedFirst.Value = dr("MailedFirst")
g_MailedFirst = dr("MailedFirst")
End If

Please HELP! I have been stuck on this for a while now. Thanks!

Brenda
 
Formatting?

If the database item is null the first time you load the datetimepicker you change the format. Do you need to change the format back to long, short etc.. when you have a valid database value? It may keep showing blank because the format is preventing it from showing anything else.
 
Back
Top