0

How can i put in my C# code the settings tags. Being more specific, i need configure TNS_ADMIN dynamically in my code. I cant use the config file (app.config).

<oracle.manageddataaccess.client>
    <version number="*">
      <dataSources>
        <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
      </dataSources>
      <settings>
        <setting name="TNS_ADMIN" value="C:\Oracle\product\11.2.0\client_1\network\admin"/>
      </settings>
    </version>
  </oracle.manageddataaccess.client>
  • 2
    May I ask *why* you can't put the settings into the config? Or why you think you need TNS_NAMES at all if your `SampleDataSource` doesn't look TNS at all? – grek40 Jan 11 '18 at 13:50
  • You can set `TNS_ADMIN` also as Environment Variable. However I am not sure about precedences. Consider also symbolic links. – Wernfried Domscheit Jan 11 '18 at 13:58
  • I don't use the config file in my application and can't set the environment variable too because the application will run in customer pc. So, i need define the TNS_ADMIN in C# at runtime setting the path of customer machine. – VitorGV Jan 12 '18 at 15:45

0 Answers0