locked
Oracle connection string RRS feed

  • Question

  • User-39953368 posted

    I am trying to use a connection string that uses TNS name and need some help. The application is using System.Data.OracleClient to handle Oracel connection (I had issues with using Oracle.DataAccess.Client). This is a Windows Service (.net, C#) and needs to be deployed on multiple app servers, each using a different database server. That's why I cannot use the regular connection string with host name (or host IP), but all servers have the same TNS defintion or tnsname.

    I tried using:

    <add name="TestingOra" connectionString="Driver={Oracle in OraClient11g_home1};DBQ=tns:TNSNAME_HERE;UID=some_user;PWD=some_password;"/>

    but it complained about missing provider. Then I added a provider name, like:

    <add name="TestingOra" connectionString="Driver={Oracle in OraClient11g_home1};DBQ=tns:TNSNAME_HERE;UID=some_user;PWD=some_password;Provider=OraOLEDB.Oracle;"/>

    I think I need to add a provider defintion (do I?).

    Friday, May 16, 2014 8:04 AM

All replies

  • User-1716253493 posted
    Try using SqlDataSource, configure through wizard, save connection. Make simple select statement. After successful, you should get new connection string in web.config.
    Friday, May 16, 2014 8:44 AM
  • User-39953368 posted

    It is an Oracle database. Also, I do not want to use host name or host IP for database server identification. I need to use a TNS name, as defined in tnsname.ora file in Oracle installation folder.

    Friday, May 16, 2014 12:39 PM