Posted on: 8/8/2013 9:18:51 PM | Views : 244

I am getting 08/09/2013 12:00:00 in txtcalDDate.Text and would like the same in a.DDate
with the below I am getting {8/9/2013 12:00:00 AM} in a.DDate. So I am missing leading 0's
a.DDate = DateTime.Parse(txtcalDDate.Text);
 I tried the below too
a.DDate = DateTime.ParseExact(txtcalDDate.Text, "MM/dd/yyyy hh:mm:ss", CultureInfo.InvariantCulture);
I need to parse it as I am reading as Datetime in C# and varchar in DB for some purpose.
 If I do this
   a.DDate = txtcalDDate.Text;  
I get Error   Cannot implicitly convert type 'string' to 'System.DateTime'  
Any ideas...
...

Go to the complete details ...