Rhino-Etl 和 MySQL 的问题

发布于 2024-08-08 10:50:29 字数 2018 浏览 4 评论 0原文

我已经使用 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();

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮年 2024-08-15 10:50:29

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

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" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文