I think
Convert.ToDateTime
will not be an efficient method to convert string into DateTime. Since it Throws FormatException if the Conversion failed, So i Strongly Recommend you to use
DateTime.TryParseExact
which has internal Exception handling mechanism So that it will Give a Return value To indicate the Conversion status and the output to the out variable. Consider the following code:
DateTime inDate;
string formatString="MM/dd/yyyy hh:mm:ss";
bool conversionResult = DateTime.TryParseExact(rsd.START_DATE, formatString, CultureInfo.InvariantCulture, DateTimeStyles.None, out inDate)
if(!conversionResult)
{
Console.WriteLine("Invalid Input");
}
Please note : The formatString and the format of the Input should match.