If you really want to you can use convert to. However using this means you do not get the features that tryparse can give you.
TryParse:
-Simple if/else validation
-Wont crash and burn your app if bad data is put into it
public static bool
{
TryParse(string s, out DateTime result)
}
Then if else validation
ConvertTo:
-If bad data is put in, your app will crash
-Better to include a try catch into this
-See the msdn article on ConvertTo
private static void ConvertToDateTime(string value)
{
DateTime convertedDate;
try {
convertedDate = Convert.ToDateTime(value);
Console.WriteLine("'{0}' converts to {1} {2} time.",
value, convertedDate,
convertedDate.Kind.ToString());
}
catch (FormatException) {
Console.WriteLine("'{0}' is not in the proper format.", value);
}
}
In my eyes you should always preference to Tryparse.