what would be the best way to pass the time value stored in an xml element into a datetime picker?
for instance, the below line throws an error as it doesn't like the format:
dateTimePicker1.Value = DateTime.ParseExact(person.Date, "HH:mm", null);
(person.date is my xml element it's reading from) the time is stored in the element as such: HH:mm
Loading
VulpesPosted Nov 23, 2012, 12:07 PM
dateTimePicker1.Value = DateTime.ParseExact(person.Date, "HHmm", null);
mike DelvottiPosted Nov 23, 2012, 12:05 PM
dateTimePicker1.Value = DateTime.ParseExact(person.Date, "HH:mm", null);
Thanks again.
VulpesPosted Nov 23, 2012, 11:42 AM
So, if it's not working then the chances are that you've not extracted it OK. Try:
MessageBox,Show(person.Date);
to make sure.
mike DelvottiPosted Nov 23, 2012, 11:20 AM
It's a string in an elemnt stored like so:
VulpesPosted Nov 23, 2012, 11:15 AM
If it's the latter, you'll need to parse its Value or InnerText property.