private void libCustomerName_Click(object sender, EventArgs e) { try { libCity.Items.Clear(); libBookingID.Items.Clear(); List <string> addresses = new List <string>(); string customer = libCustomerName.SelectedItem.ToString(); addresses = CC.GetAdresses(customer); string city = ""; foreach (string s in addresses) { if (s == city) { } else { libCity.Items.Add(s); city = s; } } } catch (Exception) { MessageBox.Show("Connection error"); } }