MySQL 的 System.Data.SqlClient 命名空间?

2022-01-23 00:00:00 mysql ado.net

The exception says that there is a network related problem, or that the SQL server does not allow remote access, none of those are true.

Can it be that I'm trying to connect a MySQL server, and not MS SQL?

Thanks

解决方案

It is because the System.Data.SqlClient namespace is designed for Microsoft SQL Server, to connect to MySQL you will need to download and reference the MySQL .NET Connector http://dev.mysql.com/downloads/connector/net/. You will then use the System.Data.MySqlClient namespace. Hope this helps.

相关文章