public ActionResult DeathRecord() { List <DeathRecord> CategoryList = new List <DeathRecord>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "FetchDeathRecord"; ds = dl.FetchDeathRecord_sp(p); try { foreach (DataRow item in ds.Tables[0].Rows) { DeathRecord m = new DeathRecord(); m.FieldId = item["FieldId"].ToString(); m.Name = item["Name"].ToString(); m.AddedBy = item["AddedBy"].ToString(); m.IsActive = item["IsActive"].ToString(); CategoryList.Add(m); } ViewBag.CategoryList = CategoryList; } catch (Exception e) { } return(View()); }