Search code examples
visual-studio-2010asp.net-mvc-3membership-providerodp.net

Get MVC3 to use Oracle for user roles and memberships


I'm having problems getting my MVC3 front end to use an Oracle 11g database to hold the user memberships.

I've been following this simple tutorial but can't get it to work.

Some things I've done so far:

  • Downloaded and installed the Oracle Data Provider for .NET (ODAC 11.2 Release 4 (11.2.0.3.0) )
  • Run the InstallAllOracleASPNETProviders.sql against the database on the development server.
  • Tested the connection via SQL developer (using the TNSNames file) with no issues.
  • Unable to create a connection to the database under the Server Explorer pane is Visual Studio 2010 which seems related.

Having checked the database I can see that the "ORA_ASPNET_" tables have been created OK.

I'd appreciate a steer on where I'm going wrong as this SHOULD be easy.


Solution

  • The problem appeared to be related to the connection string.

    I had been using the TNS names file for the connection details but this wasn't being picked up.

    I modified the connection string to include the server, port and service name as follows:

      <connectionStrings>
        <add name="OraAspNetConnectionString" 
          connectionString="Data Source=svr56:1521/TCO1103;Persist Security Info=True;User ID=Ora_Asp;Password=*****;" 
          providerName="Oracle.DataAccess.Client="/>
      </connectionStrings>
    

    The problem creating the connection is the Server Explorer also resolved itself once I used the same details in the Data source name box.

    svr56:1521/TCO1103;Persist Security Info=True;User ID=Ora_Asp;Password=*****; enter image description here