asp.net-mvcoracleasp.net-mvc-5

I want to connect to an Oracle database with my ASP.NET MVC web application


I am developing an ASP.NET MVC web application and aiming to connect it to an Oracle database. I have downloaded Oracle Managed Data Access and installed ODAC on my PC, and have configured TNS settings.

However, when attempting to add a model using ADO.NET, only SQL options appear, whereas I require Oracle to conduct CRUD operations and other tasks.


Solution

  • Looks like your IT department did not configure the ODP.NET Managed driver.

    Have a look at your Registry, you should find entries like these:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\Oracle.ManagedDataAccess]
    @="c:\\oracle\\product\\19c\\ODP.NET\\managed\\common"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\Oracle.ManagedDataAccess.EntityFramework6]
    @="c:\\oracle\\product\\19c\\ODP.NET\\managed\\common\\EF6"
    

    Either add them manually or run the config script at ...\ODP.NET\managed\x64\configure.bat true