I am trying to set / change the DateTimePicker value (using vb.net) but cannot decide how to do this.
I added a control to the page, and I tried using the following code, but it does not work, and I cannot decide how to set the value at runtime.
DateTimePicker1.Value = Now.Day & "-" & Now.Month & "-" & Now.Year
The format of the control is set to Long, and on first boot it looks like this:
Tuesday, February 26, 2013
But I canβt understand how to change it.
The error I am getting is based on my code above:
The conversion from the string "26-2-2013" to enter "Date" is invalid.
Does anyone have any idea?
Aaron
source share