private void BindTable(MyMeta.IDatabase selectDatabase, ListControl listtb) { if (selectDatabase != null) { listtb.DataSource = selectDatabase.Tables; listtb.DisplayMember = "Name"; listtb.SelectedIndex = 0; } }
private void cbxtoolStripSelectDataBase_SelectedIndexChanged(object sender, EventArgs e) { MyMeta.IDatabase database = this.cbxtoolStripSelectDataBase.ComboBox.SelectedValue as MyMeta.IDatabase; if (database != null) { BindTable(database, this.cbxtoolStripSelectObejct.ComboBox); } }
private void BindDataBase(MyMeta.IDatabase selectDatabase, ComboBox cmxdb, ListControl listtb) { cmxdb.DataSource = this.myMeta.Databases; cmxdb.DisplayMember = "Name"; if (selectDatabase != null) { cmxdb.SelectedIndex = cmxdb.FindStringExact(selectDatabase.Name); } BindTable(selectDatabase, listtb); }