[英]Problem with Rhino-Etl and MySQL
I've been using Rhino-ETL for a little while and it's running pretty smooth. 我已经使用Rhino-ETL已有一段时间了,并且运行非常平稳。 However I have a problem connecting to my MySQL DB.
但是,我在连接到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 is referenced and located in my bin folder http://dev.mysql.com/downloads/connector/net/6.1.html mysql.data被引用并位于我的bin文件夹中
My connection string i app.config looks like 我的连接字符串我app.config看起来像
<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.
我正在运行asp.net 3.5,win 7和VS 2008,并且希望在此问题上有所帮助。
A simple test in the ETL project is also working 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();
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" 在使用Type.GetType(“ xxx”)进行一些处理之后,它开始与“ MySql.Data.MySqlClient.MySqlConnection,MySql.Data”一起使用,然后重新共享建议“修复模块资格”
<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" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.