If I save the date and time in this format:
string sLogTime = "MMM ddd d HH:mm yyyy";
…what will I then have to do to convert that string into a recognizable value for a SQL Server DateTime column? Something like so:
DateTime dtLogTime = Convert.ToDateTime(sLogTime);
. . .
cmd.Parameters.Add(new SqlParameter("@logDateTime", dtLogTime));
. . .
?
Try using
ParseExactorTryParseExact: