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

VulpesRank #55 · 29.2K reputationPosted Nov 23, 2012, 6:15 AM EST
If it's the latter, you'll need to parse its Value or InnerText property.
mike DelvottiRank #7,298 · 244 reputationPosted Nov 23, 2012, 6:20 AM EST
It's a string in an elemnt stored like so:
VulpesRank #55 · 29.2K reputationPosted Nov 23, 2012, 6:42 AM EST
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 DelvottiRank #7,298 · 244 reputationPosted Nov 23, 2012, 7:05 AM EST
dateTimePicker1.Value = DateTime.ParseExact(person.Date, "HH:mm", null);
Thanks again.
VulpesRank #55 · 29.2K reputationPosted Nov 23, 2012, 7:07 AM EST
dateTimePicker1.Value = DateTime.ParseExact(person.Date, "HHmm", null);