5

I have visual studio 2012 and Oracle 11g and want to connect oracle database using OPD.NET .I downloaded the

ODAC112040Xcopy_32bit zip file and un zip the file and click the intall.bat and configure.bat then I Open the visual studio 2012 and add refrence

ODAC112040Xcopy_32bit\odp.net4\odp.net\bin\4
Oracle.DataAccess.DLL

and add in DAL.CS file using Oracle.DataAccess.Client;

but the type or namespace oracle could not found.Please guide me How I solve this problem

user3671390
  • 69
  • 1
  • 2
  • 13
  • For what it's worth the paid version of DevArt dotConnect does not require the Oracle client at all, and you can localize the assemblies, making the footprint of your application very small, for client applications. If your company is paying the bills, it's worth a look. – Hambone Jun 28 '14 at 02:24

2 Answers2

3

You can install ODP.NET via NuGet. Right click on solution and click on Manage Nuget Packages and Search for ODP.NET. You can choose Oracle.DataAccess.dll or Oracle.ManagedDataAccess.dll depending on your need.

You can use Package Manager console to install what you want

PM> Install-Package odp.net.managed

If you are using Oracle.DataAccess.dll for your build then make sure your server environments have oracle client installed. If you really want to get rid of the version conflicts for Oracle.DataAccess.dll between your build version and server then better rely on Oracle.ManagedDataAccess.dll which you can deploy under your bin folder of your application.

Dennis R
  • 3,195
  • 1
  • 19
  • 24
  • It worked but when i click start i get this error: `+this._connection null System.Data.OracleClient.OracleConnection` – csandreas1 Dec 12 '18 at 10:35
1

Have you installed the Oracle Client. You would have something in a directory like C:\app\oracle\product\11.2.0\client_1 Oracle installs some dll's and things in the gac that is required as well as the odp.net stuff I believe. Does ODP.NET require Oracle Client installation

Community
  • 1
  • 1
David Daniel
  • 134
  • 5
  • Yes, you're right. You can't just copy and paste Oracle.DataAccess.dll. OP can try to connect through sqlplus to see if it works. – fhelwanger Jun 27 '14 at 22:21