
<% @Import Namespace="System.Data" %>
<% @Import Namespace="System.Data.OracleClient" %>
<HTML>
	<HEAD>
		<title>连接到 Oracle 数据库示例</title>
		
		<script language=C# runat=server>
		
			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();
				}
			}
		
		</script>
		
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<h3>连接到 Oracle 数据库示例</h3>
			<asp:Label id="myLabel" runat="server"></asp:Label>
		</form>
	</body>
</HTML>
