<%@ Import Namespace="System.Data.OracleClient" %>
有这东东吗。好象没见过,你为什么不用工具生成呢。
看看System.Data下面有这东东吗。

解决方案 »

  1.   

    只有SQLclient
    using System.Data.OleDb;
    换成这个就行了。
      

  2.   

    我当然知道System.Data.OleDb可以,但是System.Data.OracleClient也应该可以的。我在单独的cs文件中可以编译成功(/r:System.Data.Oracleclient.dll),但不知道在IIS中如何做??
      

  3.   

    我的是.NET是1.1版本的,已经包含System.Data.OracleClient了。
      

  4.   

    我用System.Data.OleDb也出错了。
    No error information available: REGDB_E_CLASSNOTREG(0x80040154). 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: No error information available: REGDB_E_CLASSNOTREG(0x80040154).Source Error: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:1. Add a "Debug=true" directive at the top of the file that generated the error. Example:  <%@ Page Language="C#" Debug="true" %>or:2) Add the following section to the configuration file of your application:<configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.  Stack Trace: 
    [OleDbException (0x80040154): No error information available: REGDB_E_CLASSNOTREG(0x80040154).][InvalidOperationException: The 'OraOLEDB.Oracle' provider is not registered on the local machine.]
       System.Data.OleDb.OleDbConnection.CreateProviderError(Int32 hr) +83
       System.Data.OleDb.OleDbConnection.CreateProvider(OleDbConnectionString constr) +107
       System.Data.OleDb.OleDbConnection.Open() +203
       System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
       System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
       ASP.datagrid1_OLE_aspx.Page_Load(Object sender, EventArgs e) +94
       System.Web.UI.Control.OnLoad(EventArgs e) +67
       System.Web.UI.Control.LoadRecursive() +35
       System.Web.UI.Page.ProcessRequestMain() +731 
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
      

  5.   

    The 'OraOLEDB.Oracle' provider is not registered on the local machine.
    没有注册,怎么注册呢?
      

  6.   

    这可是给晕了。不会这些东东在安装的时候不注册的吧。
    是不是还要添加引用。可是应该是全局调用的啊我看是不是你的web.config有问题,里面的debug设为真看看呢
      

  7.   

    web.config??
    我才开始学asp.net,我不知道这个东西,请告诉我怎么弄,谢谢!!
      

  8.   

    那就是你的这个问题了。
    你在类里是没有这个问题的。但是在WEB页里就是要这个东东的。
    在你工程文件里。最外层有这样一个文件。
    一定是Debug=false
      

  9.   

    1)Add a "Debug=true" directive at the top of the file that generated the error. Example:  <%@ Page Language="C#" Debug="true" %>or:2) Add the following section to the configuration file of your application:<configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>
      

  10.   

    是你的WEB应用程序配置文件,每个工程都有的。在工程的最外层,你找一下。
    只要修改一下就可以了。
    应该不是你自己建的工程吧,不然不会出现这种问题的。
      

  11.   

    <%@ Page Language="C#" Debug="true" %>
    这个我加上了,不行的。
    关键是
    The 'OraOLEDB.Oracle' provider is not registered on the local machine.
    没有注册,怎么注册呢?还是这个问题。
      

  12.   

    greystar(greystar):
    还没有搞定,不过谢谢你了:)
    明天再继续
      

  13.   

    呵呵,并非所有的类在ASPX上都可用,你还必须使用<%Assembly你要知道,ASPX是运行在别的计算机上,你以保证该机上都装有完整的VS lib 吗?所以ASPX只允许精简包的.net framework 类库比如我原来使用Import Microsoft.VisualBasic 就不行。。而使用code 绑定做DLL 是可以的,建议楼主做成DLL算了。或者使用ODBC 驱动oracle 库
      

  14.   

    ArLi2003(阿利 风雨中的无爪飞龙):
    ASPX中如何添加dll?我就是不会这个呀!!
      

  15.   

    ArLi2003(阿利 风雨中的无爪飞龙):
    “你要知道,ASPX是运行在别的计算机上”,这句话好像不对吧?aspx是运行在服务器上啊