C# DateTime.ParseExact
Your format string is wrong. Change it to
insert = DateTime.ParseExact(line[i], "M/d/yyyy hh:mm", CultureInfo.InvariantCulture);
That's because you have the Date in American format in line[i]
and UK format in the FormatString
.
11/20/2011
M / d/yyyy
I'm guessing you might need to change the FormatString to:
"M/d/yyyy h:mm"