Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

oracle

ado.net

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 ?

like image 411
Nutic Avatar asked Jun 19 '13 20:06

Nutic


2 Answers

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 : enter image description here

like image 133
Jon Spokes Avatar answered Oct 16 '22 01:10

Jon Spokes


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.

like image 1
Mads Avatar answered Oct 16 '22 01:10

Mads