public ActionResult BindDoctor(string Name) { DataSet ds = BL_obj.BindDoctor(Name); List <PatientMedicalBill> obj = new List <Models.Pharmacy.PatientMedicalBill>(); foreach (DataRow dr in ds.Tables[0].Rows) { obj.Add(new Models.Pharmacy.PatientMedicalBill { DoctorID = dr["DoctorID"].ToString(), DoctorPrintName = dr["DoctorPrintName"].ToString() }); } return(new JsonResult { Data = obj, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }