public void LoadData(object sender, DoWorkEventArgs e) { doctorList = hmsfac.getDoctor(); nurseList = hmsfac.getNurse(); patientList = hmsfac.getPatient(); roomList = hmsfac.getRoom(); indpatList = hmsfac.getIndoorPatient(); prescList = hmsfac.getPrescriptions(); billpatlist = hmsfac.getBills(); this.Dispatcher.Invoke(new Action(delegate { dataGrid_Doctor.ItemsSource = doctorList; dataGrid_Nurse.ItemsSource = nurseList; dataGrid_Patient.ItemsSource = patientList; dataGrid_Room.ItemsSource = roomList; dataGrid_IndoorPatients.ItemsSource = indpatList; dataGrid_Patients_Bill.ItemsSource = billpatlist; specialization_update.ItemsSource = hmsfac.getCategories(); governedbytxt_update.ItemsSource = nurseList; cboselroom_no.ItemsSource = roomList; patname_bill.ItemsSource = patientList; patname_bill.SelectedValuePath = "pat_id"; patname_bill.DisplayMemberPath = "pat_name"; patcombobox_updatedoc.ItemsSource = doctorList; })); }