title: Connecting to Oracle using Oracle.ManagedDataAccess
body: <p>I am using Oracle.ManagedDataAccess Nuget Package Version 12.1.022 in my C# (.NET 4.0) project. The package automatically creates entries in the app.config file. How can I read the datasource string from this file to be able to connect to the data base?</p>
  
  <blockquote>
    <p>System.Configuration.ConfigurationManager.AppSettings.Get("dataSource");</p>
  </blockquote>
  
  <p>is not working for me</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="oracle.manageddataaccess.client"
               type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /&gt;
    &lt;/configSections&gt;
    &lt;system.data&gt;
      &lt;DbProviderFactories&gt;
        &lt;remove invariant="Oracle.ManagedDataAccess.Client" /&gt;
        &lt;add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client"
             description="Oracle Data Provider for .NET, Managed Driver"
             type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /&gt;
      &lt;/DbProviderFactories&gt;
    &lt;/system.data&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;publisherPolicy apply="no" /&gt;
          &lt;assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.121.2.0" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  
    &lt;oracle.manageddataaccess.client&gt;
      &lt;version number="*"&gt;
        &lt;dataSources&gt;
          &lt;dataSource alias="MyDataSource"
                      descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=100.100.100.100)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=myservice.com)))" /&gt;
        &lt;/dataSources&gt;
      &lt;/version&gt;
    &lt;/oracle.manageddataaccess.client&gt;
  &lt;/configuration&gt;
  </code></pre>