Connection string for Oracle using Entity Framework and LDAP

c# connection-string entity-framework ldap oracle

Question

I have an ASP.NET 4.0 application that is using Entity Framework 4.3 to connect to Oracle database. Connection on a development environment is not a problem because we use the standard method. Connection string was generated by Visual Studio.

Problem is that on production and acceptance environments we have to use LDAP. I have verified connection and can connect using the LDAP from Oracle's SQL Developer.

I need a help with the syntax of connection string in the web.config. How it should look like? I was not be able to find any examples and on production and acceptance I don't have Visual Studio to see if it can generate something automatically.

Update:
I need syntax to change this connection string that is connecting to local Oracle Express to connection string that uses LDAP

<connectionStrings>
    <add name="VoccDbContext" connectionString="metadata=res://*/Entities.Vocc.VoccModel.csdl|res://*/Entities.Vocc.VoccModel.ssdl|res://*/Entities.Vocc.VoccModel.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;DATA SOURCE=localhost:1521;PASSWORD=somePassKey;PERSIST SECURITY INFO=True;USER ID=someUser&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
1
2
7/19/2012 8:29:07 AM

Accepted Answer

To answer if someone else needs it. Solution is relatively simple:

LDAP.ORA file has to be modified with correct LDAP Parameters

DIRECTORY_SERVERS=(tnsnames.somesite.org:389:636)
DEFAULT_ADMIN_CONTEXT="dc=site,dc=com"
DIRECTORY_SERVER_TYPE=OID

and than the connection string is similar to the situation without the LDAP

 <connectionStrings>
    <add name="VoccDbContext" connectionString="metadata=res://*/Entities.Vocc.VoccModel.csdl|res://*/Entities.Vocc.VoccModel.ssdl|&#xD;&#xA;        res://*/Entities.Vocc.VoccModel.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;DATA SOURCE=sameDbName;PASSWORD=somePass;USER ID=someUser;&quot;"         providerName="System.Data.EntityClient" />
</connectionStrings>
3
7/27/2012 10:01:20 AM

Popular Answer

U also need to have a sqlnet.ora file in the oraclehome folder/network/admin with the following contents

# sqlnet.ora Network Configuration File

SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (LDAP,TNSNAMES,EZCONNECT)

and LDAP.ora with following contents

DEFAULT_ADMIN_CONTEXT = "dc=world"
DIRECTORY_SERVERS = (server1.x.com:389:636, server2.x.com:389:636)
DIRECTORY_SERVER_TYPE = OID

Ldap.ora help



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow