0

Ok - I have VS 2012 and VS 2013 installed on a 32-bit developer machine running Windows 7 Enterprise and am attempting to connect to an Oracle 9 database. I can install version 12.1.0.24 without a problem, and I can connect to most databases using ODP.NET Managed and Unmanaged drivers through Server Data Connections tool, etc. Problem is that I also have to build applications that connect to legacy Oracle DB Server instances, and really need an older version of the VS Tools and ODP.NET / ODAC, ie 11.2.3.20. This seemingly installs correctly, but when you try to build a new data connection, the default Data Provider is ".NET Framework Data Provider for Oracle" There is an option for "Oracle Data Provider for .NET", but there is seemingly no way to specify a tnsnames.ora location, and the only option available in the "Data Source Name" combo is "(Local Database)."

Furthermore no option for picking Managed or Unmanaged for the Provider is available. Can somebody please tell me the proper thing to do to get this to work? Are there machine-wide configurations I have to make manually, that the installer for 12.1.0.24 does automatically?

Christian Shay
  • 2,570
  • 14
  • 24
David P
  • 2,027
  • 3
  • 15
  • 27
  • ODP.NET Managed Driver is relatively new (first release was 12.1) and never allowed support for Oracle 9 databases. As Oracle 9 has not been supported for years, any new development against it will likely have to be done with old technology (old versions of our drivers and maybe even old versions of Visual Studio). And after all that, your application won't be supported by Oracle Support. So, I would make sure your customer understands what they are getting into by pursuing this new development. – Christian Shay Jan 09 '17 at 17:32
  • To address the specific issue of ODP.NET not showing up in the connect dialog, first you need to make sure that you installed "ODTwithODAC", and that you selected your version of Visual Studio to integrate with. (Note that the 11.2 version does NOT support VS 2013 or later) so you have to use VS 2012 or earlier. If you are using VS 2012 and did the above and still have the problem, try uninstalling all the Oracle client software and do a fresh install. Not seeing ODP.NET in the connect dialog means the install failed. – Christian Shay Jan 09 '17 at 17:36
  • Finally, it is possible that you do not require Visual Studio integration to develop your application (eg you do not use VS data designers or wizards to set up things like TableAdapters or Entity Framework). If that is the case, for simplicities sake I would only install ODP.NET and forget about using Oracle Developer Tools or Server Explorer. Then you are not restricted to the version of VS you use either. – Christian Shay Jan 09 '17 at 17:37

1 Answers1

0

Usually there is no need to install more than one Oracle Client (resp. one each for 32-bit and 64-bit). You can connect to older database with 12.1 client (for Managed Driver the Database must be 10.2 or newer).

Most likely you messed up your Oracle installation, remove them all and install one version from scratch.

In order to make you application independent from installed Oracle Client open *.csproj, resp. *.vbproj file and edit reference to ODP.NET like this:

<Reference Include="Oracle.DataAccess">
  <SpecificVersion>False</SpecificVersion>
  <Private>False</Private>
</Reference>

Attributes like Version=... or processorArchitecture=... are not required. Your application will load the correct Oracle.DataAccess.dll depending on selected architecture and target .NET framework (provided that it is installed properly)

"Oracle.DataAccess" and "Oracle.ManagedDataAccess" are different assemblies, so you cannot use them seamless - unless you use DbProviderFactory and such stuff.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • Yeah - I have an Oracle 9 database I need to connect to. So I uninstalled 12, and installed 11.2.3, but it doesn't work with Visual Studio tools like I described. – David P Jan 04 '17 at 20:16
  • Check this one: http://stackoverflow.com/questions/28694919/managed-odp-net-driver-does-not-show-up-in-data-source-dialog/28695779#28695779 I assume you need this only for testing, I propose to install old drivers on a (virtual) vintage machine and test your application on that machine rather than install and uninstall several Oracle clients on your development machine. – Wernfried Domscheit Jan 05 '17 at 06:33