private void QueryData() { IDbLink idal = new DbLink(); IList <DbLinkInfo> ilist = idal.DbLinkGetList(); foreach (DbLinkInfo info in ilist) { string dbName = string.IsNullOrEmpty(info.DbAbbreviation) ? info.DbName : info.DbName + "(" + info.DbAbbreviation + ")"; DBToolStripComboBox.Items.Add(new ListItem(info.ID.ToString(), dbName)); } DBToolStripComboBox.SelectedIndex = 0; }
private void Init() { IDbLink idal = new DbLink(); IList <DbLinkInfo> ilist = idal.DbLinkGetList(); foreach (DbLinkInfo info in ilist) { string dbName = string.IsNullOrEmpty(info.DbAbbreviation) ? info.DbName : info.DbName + "(" + info.DbAbbreviation + ")"; comboBoxDB.Items.Add(new ListItem(info.ID.ToString(), dbName)); } comboBoxDB.SelectedIndex = 0; //comboBoxDB.DisplayMember = "DbName"; //comboBoxDB.ValueMember = "ID"; //comboBoxDB.DataSource = ilist; }