示例#1
0
 private void SettingsUI_Load(object sender, EventArgs e)
 {
     using (var context = new UpdateJinnyDBEntities())
     {
         var countries = context.TableCityByCountries.Select(c => c.country).Distinct().ToList();
         comboBoxCountries.Items.AddRange(countries.ToArray());
     }
 }
示例#2
0
 private void comboBoxCountries_SelectedIndexChanged(object sender, EventArgs e)
 {
     using (var context = new UpdateJinnyDBEntities())
     {
         var rr = context.TableCityByCountries.Where(m => m.country == comboBoxCountries.Text).Select(c => c.city);
         comboBoxCities.Items.Clear();
         comboBoxCities.Items.AddRange(rr.ToArray());
     }
 }