if (date != "" && date != null) { System.Globalization.DateTimeFormatInfo info = new System.Globalization.DateTimeFormatInfo(); info.ShortDatePattern = "MM/dd/yyyy" DateTime ddate = DateTime.ParseExact(date, "dd/MM/yyyy", null);//here the error occures "string was not recoganized as a valid datetime" Userdir = (from u in Userdir where u.RegisteredDate >= ddate select u).OrderByDescending(c => c.RegisteredDate).ToList(); }
date
info.ShortDatePattern = "MM/dd/yyyy" DateTime ddate = DateTime.ParseExact(date, "MM/dd/yyyy", null);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)