Code line below prints System.Datetime
log.InfoFormat("{0}", row[2].GetType());
But row[2].GetType()
is never equals to System.DateTime
in condition below.
f.TestDate = (row[2].GetType() is System.DateTime) ? f.TestDate = (System.DateTime)row[2] : f.TestDate = DateTime.MinValue;
Why?