It doesn't work because you use a string format that is not valid for the string
"20/6/2014 12:45:00 PM"
For this kind of string you need a format mask like
"dd/M/yyyy hh:mm:ss tt"
However it is not very clear if you have an input date stored in a string and you want to transform it to a valid DateTime variable or, instead, you have a valid DateTime variable and want a string representing a date formatted in a specif manner.
For the first case
string validDate = "20/6/2014 12:45:00 PM";
DateTime t = DateTime.ParseExact(validDate, "dd/M/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
For the second case
DateTime d = new DateTime(2014, 6, 20, 12, 45, 0);
string validDate = d.ToString("yyyy-MM-dd h:mm:ss.fff");
Notice however, that if you want to use this value to set a field in your database through an INSERT/UPDATE query you shouldn't pass strings, but use a parameterized query passing a parameter of the correct datatype.