There are a number of things here:
fl.CreationTime looks like a
FileSystemInfo.CreationTime
or a
FileInfo.CreationTime
- which is a
DateTime
already, so you don;t need to convert it:
So...
string s = Convert.ToDateTime(fl.CreationTime).ToString();
Can be just:
string s = fl.CreationTime.ToString();
Secondly, the default ToString for a DateTime is to use the current system settings - which is very, very unlikely to be in ISO format. So the string you generate will be along the lines of
15/02/2001 17:45
which will not match the format string you are telling ParseExact to expect. So ParseExact will fail, and throw an exception. Yo could provide a parameter to ToString to generate the correct format:
Formatting a DateTime for display - format string description[
^]...
But...why are you parsing the damn string anyway?
Why not just use the original DateTime that you started with?
flist.UploadDate = fl.CreationTime;
should be all you need...