3

While my VS 2013 Update 4 installation is running I decided to ask some questions that are bothering me and which are potentially easy to answer as I couldn't test myself yet (due to having had an older VS version up until now). Also, I don't have much experience with Oracle DB's at all, I just had to use an existing one and it worked so far because someone else did all the necessary work for it to run years ago.

I have to use EntityFramework 6 together with this existing Oracle DB. I know I need an ODAC for that to work, and supposedly it has to be the newest one (12.x). What I did so far to test if EF works at all with my Oracle DB (11g):

  • Install ODAC 11.2.0.3.20 from NuGet
  • Intall EF 5 from NuGet

Then everything worked fine after some complications with updatable views.

Now to get EF 6 running with Oracle, I first need to have the newer ODAC version. Is it necessary to install the package from here, which contains a full-blown ODBC? There already is an older version of this on the PC. Is there a "standalone" installation of the ODAC available, or do I have to uninstall/reinstall the whole package on my development PC?

What I also don't know: Does every client who uses the software later need this installation, or is it possible to just ship the DLL's? As far as I know, the clients already each have an ODBC installation on their systems, and also each have a specific DB user assigned through which they read and manipulate data in the DB, if that is important to know.

Thanks in advance!

InvisiblePanda
  • 1,589
  • 2
  • 16
  • 39

2 Answers2

3

You can use the Managed Driver ODP.NET (Oracle Data Provider for .NET), you can download it from here: Oracle Data Access Components (ODAC) Downloads.

It is just a single DLL (Oracle.ManagedDataAccess.dll) you have to distribute. It works for both x86 and x64.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • Does this mean I should download the small XCopy version linked in there? And this page says I need the 32bit ODT to use the EF desinger properly; so could I use the full ODTwithODAC package on my dev machine, and still ship that single DLL file on deployment? Thanks! – InvisiblePanda Jan 13 '15 at 11:27
  • Download the tile [ODP.NET_Managed121020.zip](http://download.oracle.com/otn/other/ole-oo4o/ODP.NET_Managed121020.zip). As I wrote, it makes no difference whether you use it for 32bit or 64 bit. The zip contains also a DLL for your EF (EF6/Oracle.ManagedDataAccess.EntityFramework.dll) – Wernfried Domscheit Jan 13 '15 at 12:06
  • I downloaded the full package (ODTwithODAC) because we supposedly do need other stuff from that now as well. Now I can successfully reference the DLL you mentioned and even use the EF designer together with it. That's great! I just wonder: when we ship the application, we can include the dll; but does the user on his client PC need anything else? Like, does the user need to update his ODBC installation, or will everything "just work" when I ship the dll? Unfortunately I can't really test it yet. – InvisiblePanda Jan 13 '15 at 13:49
2

For the long time I had been using unmanaged ODP.NET and even then it was possible to use it in a fully standalone mode(although you had to drag huge DLLs with your application). This approach described here, just in case.

Now things are much easier with managed ODP.NET. I would only add(to Wernfried's answer) that if you use NuGet your could install managed version from here. But keep in mind that distributed transactions are not supported in this package.

alekseevi15
  • 1,732
  • 2
  • 16
  • 20
  • Would this be the only thing I need to add to the project then? I'm a little overwhelmed at what NuGet shows me when I search for "ODP". I assume I could also use the ODP.EntityFramework stuff. And do I still need to install the 32bit ODAC locally to use the designer, as the oracle homepage points out? Thanks! – InvisiblePanda Jan 13 '15 at 11:30
  • Yes, I believe that the only thing you need to do is to load that dependency from NuGet. Try to search for "odp.net.managed" instead. You need package named "Oracle Data Provider for .NET (ODP.NET) Managed Driver". As for EntityFramework, I think you need to install "odp.net.entityframework" dependency from Nuget as well. But, honestly, I've never used EntityFramework + Oracle combination before. But if I would need to use it I would go in that direction: loading all needed dependencies from NuGet. It simplifies deploying and managing dependecies so much. Hope it will work out for you! – alekseevi15 Jan 13 '15 at 12:23