我正在打开与本地 MySQL 服务器的连接,并在connection.Open()
它引发此错误的方法上:
System.NotSupportedException:MySQL 连接器/网络当前不支持分布式事务。
在 MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction(Transaction> 事务) 在 MySql.Data.MySqlClient.MySqlConnection.Open()
我正在做的就是这样:
var connection = new MySql.Data.MySqlClient.MySqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString);
connection.Open();
app.config 中的连接字符串是
<add name="Connection" connectionString="server=localhost;user id=userid;Password=password;database=dbname" providerName="MySql.Data.MySqlClient" />
我不知道它为什么要尝试登记事务,我没有指定任何事务并且我只有一个 MySQL 服务器要连接