我不知道我的MySql.Data发生了什么,为什么当我打开连接时总是会遇到错误。
using MySql.Data.MySqlClient;
MySqlConnection myconn = new MySqlConnection();
myconn.ConnectionString = "server=192.168.0.xxx;port=3306;database=db_name;user id=root;password=pass123";
if (myconn.State == ConnectionState.Closed)
myconn.Open();然后在myconn.Open();到达之后。

我在这里搜索堆栈中的特定错误,但是我没有看到任何答案。
PS:昨天MySqlConnection的代码运行良好,但我不知道为什么刚才出现了这个错误。
PPS : --我在不同的项目中尝试了MySqlConnection的代码,它也运行得很好,但是当涉及到我的实际项目时,它是不工作的。
发布于 2017-10-24 08:13:05
最近,我对我的项目做了一些修改。
像这样:
经过多次修改后,出现了错误。我认为正因为如此,MySqlConnection受到了影响,无法工作。
现在我不知道为什么或如何,但我通过将程序集信息从1.0.0.0更改为1.0.1.0来解决我的问题。更改程序集信息将cause the compiler to reevaluate the configuration and cause the application to refrain from creating and reading a new user.config file corresponding to the new version due to there being no user settings in the new version.
https://stackoverflow.com/questions/46903843
复制相似问题