ASP/C#.Net: How to add Oracle.DataAccess.dll to my project?

Hi,
I am developing a solution with a project in Visual Studio 2013. I am using Windows 7 Professional 32 bits, and need to connect to an Oracle 11g database .
I was reading that the way to achieve this is to use the Oracle.DataAccess.dll file.
So, I have installed the oracle client for 32 bits and my project is compiled in "Any Version" mode (because I will need to deploy it into a 64 bits Windows 2008 R2 server).

I was reading that it is not possible to just add the library as reference, so I need to know what's the correct way to add this dll library to my project so I can use it to connect to Oracle database 11g to run a query.
LVL 2
José PerezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

inxniCommented:
I've never use Oracle.DataAccess.dll so can't advise on that but there's an alternative.
Since you've already install oracle client, you can just use the following connection string and namespace oledb to connect to database.

Provider=OraOLEDB.Oracle;
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));
User Id=myUsername;Password=myPassword;

When deploy, you can just install oracle client 64bits on the server without making change to your code.
slightwv (䄆 Netminder) Commented:
Stick to ODP.Net over OLEDB.  

I would forget the full Client install and move to the new Managed Client.  There is really nothing to install.  Just copy and run the config:
http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html

All you should need to do is change the namespace in the code to use:
Oracle.ManagedDataAccess.Client
Oracle.ManagedDataAccess.Types

Then when you deploy, just deploy with the correct Bit version of the managed client.


That said:
Will the app you are creating deploy as a 64Bit app?  Just because the OS is 64Bit doesn't mean the app will be.  The Oracle drivers need to match the Bit version of the app not the OS.
José PerezAuthor Commented:
mmm and what reference library should I use?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

slightwv (䄆 Netminder) Commented:
Please forgive me on this, I just know enough .Net to be a little more than dangerous.

>>what reference library should I use?

I don't understand what you are asking here.
José PerezAuthor Commented:
To connect my project to an oracle database 11g, I must add the library (via 'References') that allow my system to connect to the database...
what we were using is the Oracle.DataAccess.dll to do it but since we are using 32 bit windows to develop, Visual Studio requires a registered COM library... for us called "Oracle.DataAccess.dll"
slightwv (䄆 Netminder) Commented:
You can use the DLL you have which is the regular ODP.Net access provider.  You should just need to have the same version and Bitness (of the app, not the OS) installed on the other machine and it should work fine.

The one I suggested, the Managed Driver, uses:  Oracle.ManagedDataAccess.dll

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slightwv (䄆 Netminder) Commented:
Can I ask what additional information you needed before providing "A" grade?
José PerezAuthor Commented:
"How to add Oracle.DataAccess.dll to my project"
slightwv (䄆 Netminder) Commented:
>>"How to add Oracle.DataAccess.dll to my project"

If the question wasn't answered then why did you close it?

I didn't see where you asked that.  I thought this question was how to deploy to a 64Bit machine when compiled on a 32Bit machine.

If the client is installed and properly configured you add the reference just like any other.

Once the DLL is referenced, it should be looked for on the remote server.  Bitness of the two shouldn't matter.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.