在ASP.NET(C#)中使用Oralce Object For OLE 2.3连接Oracle 8

作者:简简单单 2008-01-12
 
1、先在WEB应用程序项目中添加引用:Interop.OracleInProcServer
2、Web.config的配置:

 
 
 
 
 
 
 
 
 
 
 

……
3、Global.asax中创建OracleSession对象,代码如下:
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
namespace SparePart
{
 ///
 /// Global 的摘要说明。
 ///

 public class Global : System.Web.HttpApplication
 {
    ///
    /// 必需的设计器变量。
    ///

    private System.ComponentModel.IContainer components = null;
    static public OracleInProcServer._OraSessionClassClass OraSession;
    static public OracleInProcServer.OraDatabase OraDataBase;
    public Global()
    {
     InitializeComponent();
    } 
    

相关文章

精彩推荐