The type or namespace name 'oracle' could not be found error

大城市里の小女人 提交于 2019-12-31 00:59:06

问题


I am building C# Console Application to connect with database and do simple query.

But when I debug program, I get this error:

The type or namespace name 'Oracle' could not be found ( are you missing a using directive or an assembly reference? )

I need to use:

using Oracle.DataAccess.Client;

I have downloaded from Oracle site ODAC pack. Inside I have Install batch file ( i have used it ) but nothing still.

I am using MS VS2012 Express for Windows Desktop.

What file should I include when adding a reference ?


回答1:


Agreed you need to reference :

 Oracle.DataAccess.dll

You may need to be careful that you have the right Oracle client installed - if you have the 32bit one then you may need to force your app into 32 bit mode.

For distribution you may also want to include all the dependencies in your BIN folder - for 32bit that would look like :




回答2:


In the install location of the pack you downloaded there is

Oracle.DataAccess.dll

which you should reference. Here is a guide doing exactly that.



来源:https://stackoverflow.com/questions/17200790/the-type-or-namespace-name-oracle-could-not-be-found-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!