[英]MySQLConnection throws an Exception in Visual Studio
I don't know what is happening to my MySql.Data
why it is always encountering an error when I am opening a connection. 我不知道
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();
then after myconn.Open();
然后在
myconn.Open();
is reach. 达到。
I am searching for that specific error here in stack but I don't see any answer. 我正在堆栈中搜索该特定错误,但没有任何答案。
PS: The code of MySqlConnection
is working fine yesterday, but I don't know why that error appear a little while ago. PS:
MySqlConnection
的代码昨天工作正常,但我不知道为什么不久前会出现该错误。
PPS : I tried the code of MySqlConnection
in different projects and It is working fine too, but When it comes to my real project it is not working. PPS:我在不同的项目中尝试了
MySqlConnection
的代码,它也可以正常工作,但是在我的真实项目中却无法正常工作。
Lately, I have some modifications to my project 最近,我对我的项目做了一些修改
like: 喜欢:
after of that many modification when the errors occurred. 经过多次修改后才发生错误。 and I think because of that, the
MySqlConnection
was affected and not working. 因此,我认为
MySqlConnection
受到了影响,无法正常工作。
Now I don't know why or how, but I solve my problem by changing the Assembly Information from 1.0.0.0 to 1.0.1.0. 现在我不知道为什么或如何,但是我通过将Assembly Information从1.0.0.0更改为1.0.1.0解决了我的问题。 Changing the Assembly Information will 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.
更改程序集信息将导致编译器重新评估配置,并使应用程序避免创建和读取与新版本相对应的新user.config文件,因为新版本中没有用户设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.