title: Purpose of providerName="System.Data.EntityClient" in EF Designer connection string
body: <p>I created an entity framework designer diagram and when I tried to generate the database, I had to set up a connection to my password protected MySql database. I chosed not to include sensitive connection data into the automatically generated string, and so I got a connnection string without password in the App.config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;connectionStrings&gt;
      &lt;add name="DomainContainer" connectionString="metadata=res://*/Domain.csdl|res://*/Domain.ssdl|res://*/Domain.msl;provider=MySql.Data.MySqlClient;provider connection string=&amp;quot;server=localhost;User Id=the_user;database=the_db&amp;quot;" providerName="System.Data.EntityClient" /&gt;
    &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Obviously, if I then instantiate the ObjectContext like this:</p>
  
  <pre><code>var dc = new DomainContainer();
  </code></pre>
  
  <p>I get an exception ("The underlying provider failed on Open."), because MySql requires authentication. If I remove the connection string from App.config, and instead change the instantiation code to:</p>
  
  <pre><code>var connectionString = string.Format("metadata=res://*/Domain.csdl|res://*/Domain.ssdl|res://*/Domain.msl;provider=MySql.Data.MySqlClient;provider connection string=\";server=localhost;User Id=the_user;Password={0};database=the_db\"", password);
  var dc = new DomainContainer(connectionString);
  </code></pre>
  
  <p>Then the ObjectContext is able to connect and correctly persist the changes to the database (I only tried to perform insertions as of now).</p>
  
  <p>I know that this is not the recommended way of supplying a connection string by code, and instead I should use connection string builders. However I want to point out that in the process of switching from App.config supplied connection string to a code supplied one, the providerName="System.Data.EntityClient" piece of information was lost, and still the Entity Framework appears to be operating correctly. <strong>So, is that piece of information redundant in some way?</strong></p>
  
  <p><strong>Update (possibly unrelated)</strong></p>
  
  <p>I reran the MySQL Installer to double check that the installation was fine and to add a new MySQL user without password authentication (by the way, I wasn't given such an option). Instead, MySQL Installer installed a pending update (MySQL for Visual Studio 1.0.2) which appears to have damaged my installation: now the program which used to work properly a few minutes ago raises a never seen before ArgumentException:</p>
  
  <pre><code>The specified store provider cannot be found in the configuration, or is not valid.
  </code></pre>
  
  <p><strong>Update to the update</strong></p>
  
  <p>It looks like the installer created a few copies of the same MySQL assemblies in different directories of my system; maybe the runtime gets confused? However, adding the following to App.config solves the problem:</p>
  
  <pre><code>  &lt;system.data&gt;
      &lt;DbProviderFactories&gt;
        &lt;add name="MySQL Data Provider"
             invariant="MySql.Data.MySqlClient"
             description=".Net Framework Data Provider for MySQL"
             type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" /&gt;
      &lt;/DbProviderFactories&gt;
    &lt;/system.data&gt;
  </code></pre>
  
  <p>Even though I still get an error message in the error console of Visual Studio:</p>
  
  <pre><code>Errore  1   Errore 175: Il provider dell'archivio specificato non è stato trovato nella configurazione oppure non è valido. C:\Users\Dario\Documents\Programming\EFTest\EFTest\Domain.edmx  7   5   EFTest
  </code></pre>
  
  <p>Which sounds like the same as the exception mentioned in the <strong>Update</strong>, but localized in my language.</p>