public Bookings() { InitializeComponent(); try { List <string> customers = CC.GetAllCustomers(); string count = ""; foreach (string s in customers) { if (s == count) { } else { libCustomerName.Items.Add(s); count = s; } } } catch (Exception) { MessageBox.Show("Connection error"); } }