Posted on: 5/14/2015 4:46:26 PM | Views : 637

I am little unclear why would am I getting the following error - String was not recognized as a valid DateTime.
the error occurs on the following line of code.  The LastUpdated is a dateTime type from the entity framework database. 
var dateQuery = (from p in db.Database_CRE_Events.Where(c => c.LastUpdated == result) string tt = "08/05/2015 15:21:40"; DateTime result = DateTime.ParseExact(tt, "yyyy-MM-dd H:mm:ss", null); var dateQuery = (from p in db.Database_CRE_Events.Where(c => c.LastUpdated == result) select new Loan() { latest = p.Date }).FirstOrDefault(); Thank you for your help.

Go to the complete details ...