void Page_Load(object sender, System.EventArgs e) { // 连接字符串 string ORACLE_ConnStr = "Data Source=Oracle8i;Integrated Security=yes"; // 创建 OracleConnection 对象 OracleConnection oConnection = new OracleConnection(ORACLE_ConnStr); try { oConnection.Open(); myLabel.Text = "连接到 Oracle 数据库"; } catch(Exception ex) { myLabel.Text = ex.ToString(); } finally { oConnection.Close(); } }