private void cmbBoxBooks_SelectedIndexChanged(object sender, EventArgs e) { if (cmbBoxBooks.Items.Count == 0) { return; } ReservationsService reservationsService = new ReservationsService(); Book selectedBook = (Book)cmbBoxBooks.SelectedItem; List <Reservation> reservations = reservationsService.getByBook(selectedBook); reservedByList.Items.Clear(); foreach (Reservation reservation in reservations) { reservedByList.Items.Add(reservation.customer.ToString()); } }