First MVC project using entity framework – Part 2/2

By | February 7, 2015

Task :

Connect to oracle DB using and generate forms using Entity Frame Work without any coding.

Pre Requisites :

  • Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio
  • Microsoft Visual Studio 2013
  • Oracle Database Instance Credentials.
  • Entity Framework 6 Tools for Visual Studio 2012 & 2013 (
  • Oracle Database with Required Tables Employee and Department ( Refer Part 1 of This tutorial)

Complete Video Tutorial 







Right Click Models –> Add –> Select entity data model


Enter name like “EmployeeModel” and press OK


Click New Connection

Please note if you cant find Oracle database managed Driver , then please install driver from following link before you proceed further.



screen6 screen7 screen8 screen9

Now before you proceed further please build solution to make sure all is WELL upto this stage.

mvc1 mvc2

If you can see above image means then your configuration for is fine .

Now stop the instance using Shift+F5 and go ahead with adding Controllers

Now Add the two controllers (Employee and Departments) using Entity frame work

mvc3 mvc4




Follow the above same procedure and create another model for department.



Now open Layout.cshtml from the view/shared folder and add the following two lines, which will create the links in the header for the Employee and Department controllers which we created now.

 <li>@Html.ActionLink("Department", "Index", "Department")</li>
 <li>@Html.ActionLink("Employee", "Index", "Employee")</li>



Now Click Run — by pressing F5 to see the application in action.



mvc11 mvc12



  • Manjunath

    Hi Haneef Puttur,

    I went through your topics on MVC which you have explained above, and even we are trying same for our project,. Please let us know how to connect Oracle Database and entity framework in ASP .NET MVC. and below are DB version and tool which we are using

    We are using Oracle Database 11g Release – 64bit Production and Microsoft visual studio 2013

  • Haneef Puttur

    I explained in detail .. you can also refer first part of this tutorial.

  • Prakash

    Hi Haneef,

    I want to connect to Oracle 11 from Visual Studio 2013 Update 5 and Entity Framework 6 and Database First.

    I followed the same steps what you have specified but while adding connection. I’m getting “ORA-12537: Network Session: End of file” exception.. Please let me know what is the problem and how to solve this.. I spent nearly two to three days to solve this issue but not able to resolve this issue.. can you please let me know how to solve this issue or else is there any other approach is there to connect oracle from VS 2013 with EF6 databasefirst approach.

    Thanks In Advance

    • Ras Rass

      I have the same problem like you before then I follow Haneef did. Try to add New Connection > using Ez Connect > fill the required parameters > test connection to make it sure it works. Then it’s working. Thank you Haneef. You are awesome. :*

  • Ras Rass

    Thank you so much dude.. You are sooo professional !!