How to change the date format in c#,i am retrieving the information from database,in database the date format its stored in "dd/mm/yyyy",but when i getting this date to my form,its showing error,the string is not a valid datetime format. for eg "2/13/2014" while i getting error when i retrieving this date,i have tried this code
string orderd = row.Cells[1].Value.ToString();
DateTime dt = Convert.ToDateTime(lbl_date.Text);
DateTime orderdt = Convert.ToDateTime(orderd);
how to convert this date while retrieving.,
string orderd = row.Cells[1].Value.ToString();
DateTime orderdt = Convert.ToDateTime(orderd);
this code also grtting error,the row.cells[1].value is that i am getting the value from gridview,then i am converting into datetime.,but the showing "String was not recognized as a valid DateTime."
Date
? orvarchar
? – Sriram Sakthivel-
while the samples have-
in. – doctorlove