I am struggling with this. I have a datetimepicker. I have code to get data from database on form load. All that works just fine. What won't work is for the datetimepickers to be set to the date I get back from the DB. I can do a MessageBox.Show on the variable that holds the date coming back from the DB and it looks like this:
1/14/2010
But the datetimepicker control still shows todays date (the default date). I can't for the life of me get it to show the date coming back from the DB. Here is what I got:
Here is how the datetimepicker is formatted:
ddd MM/dd/yyyyyy
I have tried changing the format to "Short" but still have same issue.
Any ideas?
1/14/2010
But the datetimepicker control still shows todays date (the default date). I can't for the life of me get it to show the date coming back from the DB. Here is what I got:
Code:
If Not IsDBNull(dsProtocolInformation.Tables(0).Rows(0).Item("App_Date")) Then
Me.App_DateDateTimePicker.Value = dsProtocolInformation.Tables(0).Rows(0).Item("App_Date")
' FIXME
MessageBox.Show(mycount.ToString + " | " + dsProtocolInformation.Tables(0).Rows(0).Item("App_Date"))
End If
Here is how the datetimepicker is formatted:
ddd MM/dd/yyyyyy
I have tried changing the format to "Short" but still have same issue.
Any ideas?