private void CboCountry_SelectionChangeCommitted(object sender, EventArgs e) { AlmacenDisecWS.country c = new AlmacenDisecWS.country(); c = (AlmacenDisecWS.country)cboCountry.SelectedItem; int a = c.id_country; cboCity.DataSource = serviceDA.queryAllCitybyId(c.id_country); //El nombre del atributo a mostrar cboCity.DisplayMember = "name_city"; cboCity.ValueMember = "id_city"; }
public frmStoreHouse() { InitializeComponent(); txtId.Enabled = false; txtNameStorehouse.Enabled = true; txtAddressStorehouse.Enabled = true; txtPhone.Enabled = true; btnDelete.Enabled = false; cboCity.Enabled = true; btnBack.Enabled = true; btnSave.Enabled = true; btnDelete.Enabled = false; btnCancel.Enabled = true; serviceDA = new AlmacenDisecWS.DBControllerWSClient(); cboCity.DataSource = serviceDA.queryAllCitybyId(1); cboCity.DisplayMember = "name_city"; cboCity.ValueMember = "id_city"; cboCity.SelectedIndex = -1; txtNameStorehouse.CharacterCasing = CharacterCasing.Upper; txtAddressStorehouse.CharacterCasing = CharacterCasing.Upper; }