c# - monotouch 中的 Mysql 连接问题

标签 c# mysql xamarin.ios

我想在 monotouch 中使用 MySql connector.NET,它一直给我奇怪的错误。

错误如下:

Error CS0584: Internal compiler error: Could not import type MySql.Data.MySqlClient.MySqlConnection' fromMySql.Data, Version=6.3.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"

和:

Cannot implicitly convert type object' to MySql.Data.MySqlClient.MySqlConnection'. An explicit conversion exists (are you missing a cast?)

我使用以下代码创建连接:

string ConnectionString = "Server=localhost;" + "Database=myDatabas;" + 
                          "User ID=username;" + "Password=myPassword;" +  
                          "Pooling=false;"; 
MySqlConnection conn = new MySqlConnection ();

请帮我解决上面的错误。

最佳答案

你包括了吗

conn.ConnectionString = ConnectionString;

?

关于c# - monotouch 中的 Mysql 连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10785660/

相关文章:

c# - 对正确使用 Async/Await 的困惑

php - 从 SQL 中存储计数是否更有效?有什么缺点(同步等)?

xamarin - 如何获得在 Xamarin Studio 中创建 iOS 解决方案的选项?

c# - 基于字典排序 IEnumerable<T> 对象

c# - 有人使用过SecureBlackBox吗?

c# - 通过 PowerShell 将多个查询参数传递给 WebService

mysql - AWS RDS + INTO OUTFILE

php - 资源访问锁PHP

timer - C#/MonoTouch 启动器 : How to change the color of a Label periodically?

iphone - 通过 tableview 添加 View (UITableViewController)