Entity Framework Connect Oracle
This tutorial covers how to use Entity Framework 5 or 6, Language Integrated Query (LINQ), and generate Data Definition Language (DDL) scripts using Model-First for Oracle database. Microsoft Entity Framework abstracts the relational, logical database schema and presents a conceptual schema to the.
Attention, Internet Explorer UserAnnouncement: Oracle Community has discontinued support for Internet Explorer 7 and below.In order to provide the best platform for continued innovation, Oracle Community no longer supports Internet Explorer 7.Oracle Community will not function with this version of Internet Explorer. Please consider upgrading to a more recent version of Internet Explorer, or trying another browser such as Firefox, Safari, or Google Chrome.(Please remember to honor your company's IT policies before installing new software!).
I spent a lot of time trying to find out how to implement Entity Framework 6 database-first scenario with Oracle database. It’s not as straightforward as you might think. I searched various websites and found only confusing information. Finally I got it working, therefore I can confirm that EF6 database-first works with Oracle databases.First, let me clarify my environment.
I have Visual Studio 2013 and.NET Framework 4.5.2 installed.Secondly, a word about my goal. I wanted to create a MVC5 website that connects to existing Oracle database.So, here is how I did it. Setup Oracle Developer ToolsFirst I had to install Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio. Yep, long name. You can get it from (you’ll have to register). Make sure to take ODAC 12c Release 3 as previous versions don’t support Entity Framework 6. You will get it in a form of zip file.
Next extract it and run setup.exe (it’s java so will take some time). Standard installation worked for me – just click Next couple of times and Install. If you want to alter the installation, make sure you:. Note Software location – the default is C:appclientUSERNAMEproduct12.1.0client1. Have Oracle Developer Tools for Visual Studio component selected – that’s what we are after:). Select Visual Studio version that will be configured with the developer tools – you can select few, I needed only VS 2013. Check Configure ODP.NET at a machine-wide level – it will install it in GACInstall Entity Framework 6I wanted to use EF6 in my MVC5 web project.
A new MVC5 project has already reference to EF6, so there was nothing to do. But if you have different project you might have to install Entity Framework 6 manually. Marc OvermarsThis article/tutorial exemplifies the good about the internet.
I am working on an enterprise project and was able to leverage Oracle Database using Visual Studio 2013 Ultimate and Entity Framework 6; using your instructions. There are hundreds of articles and posting online with misleading and “throw it on the wall see if it sticks,” solution. This posting helped me get it done without fluff!It is 1:22am and I stumbled on your site. You are a very intelligent and brilliant person, and I am very lucky!Thank you!MO. Psprakash02I followed the above steps but I’m not able to connect to the database.I selected “ADO.NET Entity Data Model”, “EF Designer from Database”.
After this step, it prompts for connection.I selected “New Connection” and in the connection properties, I selected “Oracle Database (ODP.Net Managed Driver) and entered the database details.After entering all the details, when I click Test Connections. I’m getting an exception like “ORA-12537: Network Session: End of file”. And it is not allowing me to proceed further in this. Please let me know what is causing the issue and how to solve this?.
NeoHi, I have followed all steps and able to add ADO.net Entity Data Model successfully but when I try to save data I get below error, kindly help. What I have missed?The Entity Framework provider type ‘Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342’ registered in the application config file for the ADO.NET provider with invariant name ‘Oracle.ManagedDataAccess.Client’ could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See for more information. RichardYou appear to have solved my problem of getting Oracle into Visual Studio 2013 for Entity Framework. I couldn’t help but notice a discrepancy in version numbers from what you posted.
Admittedly I’m using a slightly newer version of: Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio (ODAC 12c Release 4 (12.1.0.2.4)) but the version numbers you posted into the web.config. RajThis is very well written article. I was able to create a prototype that works with oracle database with entity framework. Incidentally I have the same environment VS 2013,EF6. My app works without addingget this error:(Configuration ErrorUnrecognized element ‘providers’.)orGet this error(HTTP Error 500.19 – Internal Server ErrorThe requested page cannot be accessed because the related configuration data for the page is invalid.)in the web config.As I said the application works fine on my machine.But how do we deploy it on the server? Will it cause any issues?Thanks,Raj. Ashraful AlamI have followed your instructions to setup a MVC5 project with EF6 and Oracle database.
I have installed the ODAC with oracle developer tools with visual studio from oracle site and added Oracle.ManagedDataAccess.dll & Oracle.ManagedDataAccess.EntityFramework.dll as reference. Then I have added the section and on web.config file. Modding skyrim special edition guide. I rebuild the project and tried to ADO.Net Entity Data Model but still got the compatibility error on Choose your version section of the Wizard.My Environment: Visual Studio 2003, Oracle 11g.Is there anything I am missing to that? Thanks in advance.
RaviHi Mariusz,Excellent Article!!I am developing a web application using VS2015, Entity Framework 6.1.3 & Oracle.ManagedDataAccess v12.1.2400 Oracle.ManagedDataAccess.EntityFramework v12.1.2400. I have finished couple of modules and it works fine in my local machine now i am deploying this application in Windows Server 2012 R2 but i can only access Login page nothing else, i am sure it has something to do with database access, Kindly advise do we need to install anything manually & it will not read from bin folder. At the moment in server i have only.Net Framework 4.5Thanks & Regards,Ravi.Pingback:.Pingback:. JasonThis may be a long forgotten blog posting, but I will try anyway. We have gone thru steps and everything works fine on our local workstations. However, deploying to the server is a different story.
Entity Framework Oracle Connection
Our Windows 2012R2 server has the 12 client installed, not just ODAC, the full Oracle client. When we put our.NET console app on the server and run it, it crashes every time. Seems to die on the line that tries to access the entity framework. I know the server has Oracle connectivity because I can open the database thru Oracle Developer and run queries.
Entity Framework Oracle Connection String Schema
Do we need the full Oracle client on the server for this to work or should we uninstall the client and just install the ODAC release 3 client like we did locally?. UmaI’m using VS 2013, EF 6.0.2,.net 4.0 and Oracle Db. While building sln: warning MSB3274: The primary reference “Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL” could not be resolved because it was built against the “.NETFramework,Version=v4.5” framework. This is a higher version than the currently targeted framework “.NETFramework,Version=v4.0”.I cant go to 4.5 for compatibility issues. Pls suggest.