public ActionResult Index(EMP emp) { if (ModelState.IsValid) { EMPModelView empl = new EMPModelView(); empl.AddNewEmployee(emp); //////////////////Dept Number Drop Down////////////////// var list = new List <DeptDropDown>(); OracleConnection con = new OracleConnection(oradb); OracleCommand cmd = new OracleCommand(); cmd.CommandText = "Select d.deptno,d.dname From dept d"; cmd.Connection = con; con.Open(); OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { list.Add(new DeptDropDown { Deptid = reader.GetInt16(0), Dname = reader.GetString(1) }); } var model = new DeptModellist(); ViewBag.drop = new SelectList(list, "deptid", "dname"); //////////////////Dept Number Drop Down////////////////// return(RedirectToAction("index", "Home")); } return(View()); }