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