
I used like this d.PODate.ToString() to display(see image) I can see it using inspect element... I want to display only date not a time and when I try to use d.PODate.ToString("d") it gave me error like this Method 'System.String ToString(System.String)' has no supported translation to SQL and same to d.PODate.ToShortDateString() got error like this Method 'System.String ToShortDateString()' has no supported translation to SQL.
EDIT
this is my GET method
[HttpGet] public Models.SysDataTablePager Get() { NameValueCollection nvc = HttpUtility.ParseQueryString(Request.RequestUri.Query); string sEcho = nvc["sEcho"].ToString(); int iDisplayStart = Convert.ToInt32(nvc["iDisplayStart"]); string sSearch = nvc["sSearch"].ToString(); int iSortCol = Convert.ToInt32(nvc["iSortCol_0"]); string sSortDir = nvc["sSortDir_0"].ToString(); var BranchId = Convert.ToInt32(((wfmis.Global)HttpContext.Current.ApplicationInstance).CurrentBranchId); var Count = db.TrnPurchaseOrders.Where(d => d.MstUser.Id == secure.GetCurrentUser() && d.MstBranch.Id == BranchId).Count(); var PurchaseOrders = from d in db.TrnPurchaseOrders where d.MstBranch.Id == BranchId && d.MstBranch.MstUser.Id == secure.GetCurrentUser() select new Models.TrnPurchaseOrder { Id = d.Id, PeriodId = d.PeriodId, Period = d.MstPeriod.Period, BranchId = d.BranchId, Branch = d.MstBranch.Branch, PONumber = d.PONumber, POManualNumber = d.POManualNumber, //PODate = d.PODate.ToShortDateString(), PODate = d.PODate.ToShortDateString(), //<------ SupplierId = d.SupplierId, Supplier = d.MstArticle.Article, TermId = d.TermId, Term = d.MstTerm.Term, RequestNumber = d.RequestNumber, //DateNeeded = d.DateNeeded.ToShortDateString(), DateNeeded = d.DateNeeded.ToString(), //<------ Particulars = d.Particulars, RequestedById = d.RequestedById == null ? 0 : d.RequestedById.Value, RequestedBy = d.MstUser.FullName, IsClosed = d.IsClosed, PreparedById = d.PreparedById, PreparedBy = d.MstUser.FullName, CheckedById = d.CheckedById, CheckedBy = d.MstUser1.FullName, ApprovedById = d.ApprovedById, ApprovedBy = d.MstUser2.FullName, IsLocked = d.IsLocked, CreatedById = d.CreatedById, CreatedBy = d.MstUser3.FullName, //CreatedDateTime = d.CreatedDateTime.ToShortDateString(), CreatedDateTime = d.CreatedDateTime.ToString(), UpdatedById = d.UpdatedById, UpdatedBy = d.MstUser4.FullName, //UpdatedDateTime = d.UpdatedDateTime.ToShortDateString() UpdatedDateTime = d.UpdatedDateTime.ToString() }; switch (iSortCol) { case 2: if (sSortDir == "asc") PurchaseOrders = PurchaseOrders.OrderBy(d => d.PODate).Skip(iDisplayStart).Take(10); else PurchaseOrders = PurchaseOrders.OrderByDescending(d => d.PONumber).Skip(iDisplayStart).Take(10); break; case 3: if (sSortDir == "asc") PurchaseOrders = PurchaseOrders.OrderBy(d => d.PONumber).Skip(iDisplayStart).Take(10); else PurchaseOrders = PurchaseOrders.OrderByDescending(d => d.PODate).Skip(iDisplayStart).Take(10); break; case 4: if (sSortDir == "asc") PurchaseOrders = PurchaseOrders.OrderBy(d => d.Supplier).Skip(iDisplayStart).Take(10); else PurchaseOrders = PurchaseOrders.OrderByDescending(d => d.Supplier).Skip(iDisplayStart).Take(10); break; default: PurchaseOrders = PurchaseOrders.Skip(iDisplayStart).Take(10); break; } var PurchaseOrderPaged = new Models.SysDataTablePager(); PurchaseOrderPaged.sEcho = sEcho; PurchaseOrderPaged.iTotalRecords = Count; PurchaseOrderPaged.iTotalDisplayRecords = Count; PurchaseOrderPaged.TrnPurchaseOrderData = PurchaseOrders.ToList(); return PurchaseOrderPaged; } EDIT 2
I got this on my DateTime on my database... 
ToShortDateString()method. You can add a mapping function yourself, which then uses SQL syntax to trim the date you are fetching from your database into a string.