cls_Con.comboFill(this.com_Section, "select * from [section] where c_name="+com_Class.SelectedItem.ToString()+"", "[section]", "sec_name", "sec_id");
public void comboFill(ComboBox cmb, string strSQL, string dTable, string dDisplay, string dValue) { try { cmb.DropDownStyle = ComboBoxStyle.DropDownList; //OleDbCommand cmd = new OleDbCommand(); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(strSQL, cn); da.Fill(ds, dTable); cmb.DataSource = ds.Tables[dTable].DefaultView; cmb.DisplayMember = dDisplay; cmb.ValueMember = dValue; } catch (Exception exp) { MessageBox.Show(exp.Message); }
_class.clsODBC cls_Con = new School._class.clsODBC(); OleDbCommand cmdForm = new OleDbCommand();