2 Replies Latest reply: Sep 14, 2012 2:56 PM by Charlie (ME) RSS

    Using LDAP (OID) in place of TNSNAMES in .Net web.config file

    Charlie (ME)
      We have an application that stores the TNS entry in the web.config like so:
      <connectionStrings>
          <add name="REPORTS" connectionString="Data Source=(DESCRIPTION=
                  (ADDRESS=
                      (PROTOCOL=TCP)
                      (HOST=<some_server1.domain>)
                      (PORT=1521))
                  (ADDRESS=
                      (PROTOCOL=TCP)
                      (HOST=<some_server2.domain>)
                      (PORT=1521))
                  (LOAD_BALANCE=yes)
                  (CONNECT_DATA=
                      (SERVER=DEDICATED)
                      (SERVICE_NAME=<SID>)
                      (FAILOVER_MODE=(TYPE=SELECT)
                      (METHOD=BASIC)
                      (RETRIES=180)
                      (DELAY=5))));
                  User Id=<user_name>;
                  Password=<password>;
                  Pooling=true;
                  Connection Lifetime=0;
                  Max Pool Size=300;
                  Min Pool Size=1;"
                  providerName="Oracle.DataAccess.Client Version 11.2.0.1.2"/>
      </connectionStrings>
      Is it possible to change just the web.config file so that we can connect using LDAP/OID without having to make coding changes the the application itself?
        • 1. Re: Using LDAP (OID) in place of TNSNAMES in .Net web.config file
          ReubenC
          I think if you remove the tns data from the connection string it should connect fine as long as you're not doing any manual parsing of it. (remove starting from "(DESCRIPTION" to "))));" and replace with network service name;)
          Maybe backup the config file before trying that though...

          I think retries and delay would be set by ldap.
          • 2. Re: Using LDAP (OID) in place of TNSNAMES in .Net web.config file
            Charlie (ME)
            Thank you ReubenC, the business has decided to not proceed with the LDAP configuration of web.config at this time and would rather stay with using the TNS entry for the time being; this is because we just mirgated their instance to an 11g environment and they want to ensure they have no issues with the migration before they take on web.config changes too.

            I will however try your recommendation when they choose to proceed and let you know how it turns out.

            Thank you,
            Charlie