Here i have a Query Like 'select * from Employees where DataofJoin= '2001-01-01 00:00:00.000'; I convert this query into linq as
public JsonResult Dif(int Date = 0, int Month = 0, int Year = 0)
{
var date = new DateTime(Year, Month, Date);
var x = (from n in db.Employees
where n.DataofBirth == date
select n).First();
return new JsonResult { JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
But whenever i try to enter the date Like as shown in sql query its takes date Like '{1/1/0001 12:00:00 Am}' And its through Error Like occurred in System.Core.dll but was not handled in user code1:17 AM 10/21/2016