private void button3_Click(object sender, EventArgs e) { oracle_link ss = new oracle_link(); string sql = " select * from dual "; string ll = ""; try { ss.Open(); var ord = ss.Oracle(sql); if (ord.Read()) { ll = ord.GetOracleString(0).ToString(); } if (ll != "X") { MessageBox.Show("数据库信息保存失败"); } else { MessageBox.Show("测试成功"); // this.Close(); } } catch (Exception ee) { MessageBox.Show("" + ee); } finally { ss.Close(); } }