I have a form with few datetime pickers, to be exact two pairs of dates and times.
Data from those pickers is combined and saved to database as DateTime in format
16/05/2012 11:28:00 a.m.
Now, what I want to do is get value from database and put it into datetime pickers.
I've tried something like
string plannedDate =(dbFunctions.SQLReadColumn("task", "PlannedDate", TaskID));
DateTime pDate = new DateTime(plannedDate.Substring(0,9);
dtpDatePicker.Value=pDate;
where plannedDate contains string data in format as mentioned above, but I can't convert it to DateTime (second line incorrect). Is there an easy way to do it or do I have to cut the string into pieces for year, month etc?