I have string "24-04-2015 00:00:00"
. I need convert it into datetime and store it in database.
If i pass "24-04-2015 00:00:00"
as a string to database, I am getting the error
"Failed to convert parameter value from a String to a DateTime."
And also if i use DateTime.ParseExact("24-04-2015 00:00:00", "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
I am getting below error
String was not recognized as a valid DateTime.