you have additional space
"yyyyMMdd ",
remove that and check
but I would use
DateTime.TryParseExact Method[
^] here as below. We can handle invalid user inputs without throwing an exception. :-)
string valdate = "20140525";
DateTime MyDateTime ;
if(DateTime.TryParseExact(valdate, "yyyyMMdd",
System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None,out MyDateTime))
{
}