public ActionResult Expensehead() { List <Expensehead> CategoryList = new List <Expensehead>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "FetchExpensehead"; ds = dl.FetchExpensehead_sp(p); try { foreach (DataRow item in ds.Tables[0].Rows) { Expensehead m = new Expensehead(); m.HeadId = item["HeadId"].ToString(); m.HeadName = item["HeadName"].ToString(); m.Description = item["Description"].ToString(); m.AddedBy = item["AddedBy"].ToString(); m.IsActive = item["IsActive"].ToString(); CategoryList.Add(m); } ViewBag.CategoryList = CategoryList; } catch (Exception e) { } return(View()); }