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();
}
}
2020-01-09 03:15:00
3.42MB
C#
1