Import Namespace="System.Data.OracleClient"出错

arefe 2003-06-15 04:06:34
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0234: The type or namespace name 'OracleClient' does not exist in the class or namespace 'System.Data' (are you missing an assembly reference?)

Source Error:



Line 1: <%@ Import Namespace="System.Data" %>
Line 2: <%@ Import Namespace="System.Data.OracleClient" %>
Line 3:
Line 4: <html>

如何解决??
...全文
154 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
arefe 2003-06-16
  • 打赏
  • 举报
回复
.........
greystar 2003-06-15
  • 打赏
  • 举报
回复
所有的工作都是在服务器上完成的。这个问题有点怪,我要试一下,是不是这种结果。
2003
arefe 2003-06-15
  • 打赏
  • 举报
回复
ArLi2003(阿利 风雨中的无爪飞龙):
“你要知道,ASPX是运行在别的计算机上”,这句话好像不对吧?aspx是运行在服务器上啊
arefe 2003-06-15
  • 打赏
  • 举报
回复
ArLi2003(阿利 风雨中的无爪飞龙):
ASPX中如何添加dll?我就是不会这个呀!!
ArLi2003 2003-06-15
  • 打赏
  • 举报
回复
呵呵,并非所有的类在ASPX上都可用,你还必须使用<%Assembly

你要知道,ASPX是运行在别的计算机上,你以保证该机上都装有完整的VS lib 吗?所以ASPX只允许精简包的.net framework 类库

比如我原来使用Import Microsoft.VisualBasic 就不行。。而使用code 绑定做DLL 是可以的,建议楼主做成DLL算了。或者使用ODBC 驱动oracle 库
arefe 2003-06-15
  • 打赏
  • 举报
回复
greystar(greystar):
还没有搞定,不过谢谢你了:)
明天再继续
arefe 2003-06-15
  • 打赏
  • 举报
回复
我自己在学习:)就我自己做
greystar 2003-06-15
  • 打赏
  • 举报
回复
我不相这种东东在安装时没有注册的。那这个工程是你自己开始做的吗。
还是别人的,你在里面调试
arefe 2003-06-15
  • 打赏
  • 举报
回复
<%@ Page Language="C#" Debug="true" %>
这个我加上了,不行的。
关键是
The 'OraOLEDB.Oracle' provider is not registered on the local machine.
没有注册,怎么注册呢?

还是这个问题。
greystar 2003-06-15
  • 打赏
  • 举报
回复
是你的WEB应用程序配置文件,每个工程都有的。在工程的最外层,你找一下。
只要修改一下就可以了。
应该不是你自己建的工程吧,不然不会出现这种问题的。
greystar 2003-06-15
  • 打赏
  • 举报
回复
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>


greystar 2003-06-15
  • 打赏
  • 举报
回复
那就是你的这个问题了。
你在类里是没有这个问题的。但是在WEB页里就是要这个东东的。
在你工程文件里。最外层有这样一个文件。
一定是Debug=false
arefe 2003-06-15
  • 打赏
  • 举报
回复
web.config??
我才开始学asp.net,我不知道这个东西,请告诉我怎么弄,谢谢!!
greystar 2003-06-15
  • 打赏
  • 举报
回复
这可是给晕了。不会这些东东在安装的时候不注册的吧。
是不是还要添加引用。可是应该是全局调用的啊

我看是不是你的web.config有问题,里面的debug设为真看看呢
arefe 2003-06-15
  • 打赏
  • 举报
回复
The 'OraOLEDB.Oracle' provider is not registered on the local machine.
没有注册,怎么注册呢?
arefe 2003-06-15
  • 打赏
  • 举报
回复
我用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
greystar 2003-06-15
  • 打赏
  • 举报
回复
那不好意思。我装是装了。2003,
不过现在也一直没有用过。打扰你了。
帮你问问
arefe 2003-06-15
  • 打赏
  • 举报
回复
我的是.NET是1.1版本的,已经包含System.Data.OracleClient了。
arefe 2003-06-15
  • 打赏
  • 举报
回复
我当然知道System.Data.OleDb可以,但是System.Data.OracleClient也应该可以的。我在单独的cs文件中可以编译成功(/r:System.Data.Oracleclient.dll),但不知道在IIS中如何做??
greystar 2003-06-15
  • 打赏
  • 举报
回复
只有SQLclient
using System.Data.OleDb;
换成这个就行了。
加载更多回复(1)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧