c# - Rhino-Etl 和 MySQL 的问题

标签 c# mysql etl rhino

我已经使用 Rhino-ETL 一段时间了,它运行起来非常流畅。但是,我在连接到我的 MySQL 数据库时遇到问题。

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 被引用并位于我的 bin 文件夹中

我的连接字符串 i app.config 看起来像

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

连接字符串在一个简单的网站中工作正常,用于调试目的,作为数据源。我正在运行 asp.net 3.5、win 7 和 VS 2008,我将不胜感激在此问题上的任何帮助。

ETL项目中的一个简单测试也是可以的

            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();

最佳答案

在使用 Type.GetType("xxx") 后,它开始使用“MySql.Data.MySqlClient.MySqlConnection, MySql.Data”,然后 resharper 建议“修复模块资格”

<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" />

关于c# - Rhino-Etl 和 MySQL 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1590767/

相关文章:

c# - 为单元测试 stub ASP.NET Page.Form

c# - 使用自定义 Nuget 包更改当前 web.config

c# - 将 DbContext.SaveChanges 异常记录到 Entity Framework/Entity Framework Core 中的数据库

php - 在 CakePHP 3 中更新/插入关联表数据

etl - 如何使用 Scriptella 对多个文件进行 ETL?

database - Hadoop会取代ETL吗?

python - 如何让 Python 智能地将动态输入转换为固定宽度输出?

c# - Properties.Settings.Default 存储在哪里?

mysql - Rails MYSQL 迁移仅在测试时失败?

mysql - 如何选择一组行的sum()和另一组的sum()