Problems connecting to local MySQL server

隐身守侯 提交于 2019-11-28 13:14:27

You cannot use the SqlConnection class to connect to MySQL. Instead, install MySqlConnector from NuGet, then use:

using (IDbConnection connection = new MySqlConnection(Helper.CnnVal("workloadDB")))
{
    var output = connection.Query<Task>($"select * from task where id=1").ToList();          
}

Your connection string looks like it should be compatible with MySqlConnection, but if you're using any other options you should double-check them against the list of valid connection options.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!