Failed to find or load the registered .Net Framework Data Provider exception subsonic

subsonic

i created a dataaccess dll with subsonic. now i am using it with my app but i keep getting exceptions when i access it.
{"Failed to find or load the registered .Net Framework Data Provider."}

it keeps hitting this exception when it goes thro this block of code

 public dbTorontoTraderDB() 
        {
            if (DefaultDataProvider == null) {
                DataProvider = ProviderFactory.GetProvider("dbTorontoTrader");
            }

my app.config has the db defined. i dont know where and how to fix it.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>

    <add name="dbTorontoTrader"
       connectionString="server=localhost;database=dbtorontotrader;user id=root; password=password"
       providerName="MySql.Data.MySqlClient"/>
    <!-- For MySQL -->
  </connectionStrings>
  <system.data>
    <DbProviderFactories>
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=5.1.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
</configuration>

Best Answer

i had to change the version # on the app.config to match my mysql version. Version=6.2.2.0