private void cbRestaurants_DropDown(object sender, EventArgs e) { try { var NSC = new NewsServiceClient("BasicHttpBinding_INewsService", $"http://{wcfServerIp}/INewService"); int sitsCount = Convert.ToInt32(nudSitsCount.Value); string[] restaurantsWithSitsCount = NSC.SelectRestWithCount(sitsCount); cbRestaurants.Items.Clear(); foreach (var restaurant in restaurantsWithSitsCount) { cbRestaurants.Items.Add(restaurant); } } catch (Exception) { MessageBox.Show("Server with restaurants is not connected right now"); } }