public JsonResult GetAllHospitalLocation(string prefix) { Users Obj_Model = new Models.Keystone.Users(); Obj_Model.StoreAllHospital = user.GetAllHospitalLocation(); List <Users> serch = new List <Users>(); foreach (DataRow dr in Obj_Model.StoreAllHospital.Tables[0].Rows) { serch.Add(new Users { HospitalID = Convert.ToInt32(dr["HospitalID"]), HospitalName = dr["HospitalName"].ToString(), }); } return(new JsonResult { Data = serch, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }