Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using Oracle.DataAccess.Client; not found after download and install OPD.NET

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

like image 654
user3671390 Avatar asked Oct 01 '22 11:10

user3671390


2 Answers

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.

like image 121
Dennis R Avatar answered Oct 03 '22 02:10

Dennis R


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

like image 25
David Daniel Avatar answered Oct 03 '22 02:10

David Daniel