Guy E
Guy E

Reputation: 1927

Oracle Data provider for .NET in visual studio

Newbi to oracle and its versions and .NET providers, but did some investigation. I'm trying to add Oracle connection to the visual studio server Explorer (before setting up the Entity Framework 6 for oracle). System preferences: Windows 10 enterprise - 64 bit operating system Visual Studio 2015

Oracle Data Access Components (ODAC) which includes Oracle developer Tools for Visual Studio: ODAC12C - 12.2.0.1 - it is suitable to 64 bit !

The DB is located in a remote machine and I can see the DB objects using the Oracle SQL developer. It uses the TNSNames file to locate the DBs.

when trying to "add connection" in the visual studio server explorer: Select Data Source: Oracle DataBase Data Provider:.NET framework data provider for Oracle. It claims that:

"This provider is deprecated and should not be used. Instead download Oracle Developer tools for visual studio for comprehensive integration with Oracle database."

The problem is that the mentioned above reference links to a 32-bit Oracle Data Access Components (ODAC) bundle which includes "Oracle Developer Tools for Visual Studio". The same shXX happens when choosing .NET framework data provider for OLEDB.

Either I don't see the relevant provider in the list or there is a problem.
After inserting Server name, User name and Password in the "Add connection" dialog box, I get this error message:

"Attempt to load Oracle Client libraries threw BadImageFormatException. This problem will occur when running 64 bit mode with the 32 bit Oracle Client components installed"

What am I doing wrong ?

Is this the way of defining connection string when I have a TNSNames file ?

Upvotes: 1

Views: 3570

Answers (1)

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59456

Microsoft .NET Framework Data Provider for Oracle is different to Microsoft OLE DB Provider for Oracle which is different to Oracle Data Access (which can be Oracle Data Provider for .NET or Oracle Data Provider for .NET Managed Driver or Oracle Provider for OLE DB, depending on which one you installed), see How to connect to Oracle 11 database from . net

Visual Studio 2015 is 32-bit, when you like to connect to an Oracle database directly from Visual Studio Explorer then you have to download/install the 32-bit version of ODAC - and also install 32-bit Oracle Client.

In case you like to use also 64-bit Oracle Client and drivers follow this instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed

Upvotes: 1

Related Questions