MySQL “network-related or instance-specific error occurred while establishing a connection to SQL Server”

假如想象 提交于 2019-12-01 18:49:21
JW Lim

SqlConnection is for SqlServer. To connect to MySql you need to download some drivers and reference it in your project, and use MySqlConnection instead.

Take a look at this question and this CodeProject sample.

As @JW Lim and @Kirk Woll suggested, the issue was caused by the use of the System.Data.SqlClient, which is used alongside SQLServer.

For this project, seeing as I am keeping it local, the use of MySql.Data.MySqlClient is the correct way to approach this.

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