title: Don't understand why DbProviderFactories.GetFactory is returning NULL
body: <p>In my C# application, I have roughly the following code:</p>
  
  <p><strong>In App.Config:</strong></p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add name="Con1" connectionString="..." providerName="System.Data.Odbc"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p><strong>In My Code:</strong></p>
  
  <pre><code>static DbConnection createConnection(ConnectionStringSettings conn_str)
  {
      DbProviderFactory factory = DbProviderFactories.GetFactory(conn_str.ProviderName);
      var retval = factory.CreateConnection();
      retval.ConnectionString = conn_str.ConnectionString;
      return retval;
  }
  </code></pre>
  
  <p>This creates for me a connection variable, <code>conn</code> and works great (I can open the connection, query it, etc), so I know I'm referencing the correct libraries.</p>
  
  <p>However, later on, I need to get the factory again and use:</p>
  
  <pre><code>DbProviderFactory factory = DbProviderFactories.GetFactory(conn);
  </code></pre>
  
  <p>But, for whatever reason, I get back that <code>factory = null</code>.</p>
  
  <p>Am I doing something plainly wrong?</p>