private void cargarCombo(ComboBox combo, string nombreTabla, int parametro) { DataTable tabla = new DataTable(); tabla = miGestor.consultarTabla(nombreTabla); combo.DataSource = tabla; combo.DisplayMember = tabla.Columns[1].ColumnName; combo.ValueMember = tabla.Columns[0].ColumnName; combo.DropDownStyle = ComboBoxStyle.DropDownList; combo.SelectedValue = parametro; }
private void CargarComboBasic(ComboBox combo, string nombreTabla) { DataTable tabla = new DataTable(); tabla = miGestor.consultarTabla(nombreTabla); combo.DataSource = tabla; combo.DisplayMember = tabla.Columns[1].ColumnName; combo.ValueMember = tabla.Columns[0].ColumnName; combo.DropDownStyle = ComboBoxStyle.DropDownList; combo.SelectedIndex = 0; }