public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SetupActivitiesSelectList(); try { int i = Convert.ToInt32(id); ConnectDb c = new ConnectDb(); return(View(c.GetEntry(i))); } catch (Exception e) { return(View()); } }