tags:

views:

363

answers:

1

I've been using Rhino-ETL for a little while and it's running pretty smooth. However I have a problem connecting to my MySQL DB.

Rhino.Etl.Core.RhinoEtlException: Failed to execute operation Hornalen.Migration
.Process.ReadMessagesFromDb: The type name 'MySql.Data.MySqlClient' could not be
 found for connection string: testConnectionString ---> System.InvalidOperationE
xception: The type name 'MySql.Data.MySqlClient' could not be found for connecti
on string: testConnectionString
   at Rhino.Etl.Core.Infrastructure.Use.Connection(String name)
   at Rhino.Etl.Core.Operations.InputCommandOperation.<Execute>d__0.MoveNext()
   at Rhino.Etl.Core.Enumerables.SingleRowEventRaisingEnumerator.MoveNext()
   at Rhino.Etl.Core.Enumerables.EventRaisingEnumerator.MoveNext()
   at Rhino.Etl.Core.Pipelines.ThreadPoolPipelineExecuter.<>c__DisplayClass1.<De
   corateEnumerableForExecution>b__0(Object )
   --- End of inner exception stack trace ---

http://dev.mysql.com/downloads/connector/net/6.1.html mysql.data is referenced and located in my bin folder

My connection string i app.config looks like

    <add name="testConnectionString" connectionString="server=localhost;user id=dev;password=xxxxx;persist security info=True;Database=test"
providerName="MySql.Data.MySqlClient" />

The connection string works fine in a simple website, for debugging purpose, as a data source. I'm running asp.net 3.5, win 7 and VS 2008, and I would appreciate any help on this issue.

A simple test in the ETL project is also working

            MySql.Data.MySqlClient.MySqlConnection connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString);
        connection.Open();
        MySqlCommand command = connection.CreateCommand();
        command.CommandText = "select * from arter";
        MySqlDataReader reader = command.ExecuteReader();
        while (reader.Read())
        {
            System.Console.WriteLine(reader.GetInt32("artId"));    
        }
        connection.Close();
+1  A: 

After some work with Type.GetType("xxx") it started to work with "MySql.Data.MySqlClient.MySqlConnection, MySql.Data" and then resharper suggested "Fix module qualification"

<add name="testConnectionString" connectionString="server=localhost;user id=dev;password=xxxxx;persist security info=True;Database=test"
providerName="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=6.1.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
orjan