public void GetAllVisitorsDetails() { try { //var AllVisitors = objVisEnti.tblVisitors.ToList().OrderByDescending(m => m.Id); var AllVisitors = objVisEnti.uspGetVisitorDetailsNew().ToList(); ViewBag.AllVisitorsDetalis = AllVisitors; } catch (Exception ex) { throw ex; } }
public ActionResult LoadData() { try { //Creating instance of DatabaseContext class using (DBNCSVisitorEntities dc = new DBNCSVisitorEntities()) { var data = dc.uspGetVisitorDetailsNew().OrderBy(a => a.GovIdNo).ToList(); return(Json(new { data = data }, JsonRequestBehavior.AllowGet)); } } catch (Exception) { throw; } }