//初始化院区下拉列表,使用了Oracle数据库中的表项目 try { //string connString = "User=system;Password=manager;Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.80.13)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = oracleService)))"; string connString = "User=system;Password=123456;Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = oracleService)))"; OracleConnection conn = new OracleConnection(connString); try { conn.Open(); OracleCommand cmd = new OracleCommand("select t.hosp_zonename from org_hospitalzone_dict t", conn); OracleDataReader odr = cmd.ExecuteReader(); while (odr.Read()) { this.comboBox_HospitalZone.Items.Add(odr[0].ToString()); } odr.Close(); conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Close(); } //this.tabControl.SelectedIndex = 2;//设置默认选项,idnex号码是从0开始的 } catch (Exception exp) { MessageBox.Show(exp.Message); }