Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Data.SqlClient Namespace for MySQL?

Tags:

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


1 Answers

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.

like image 62
Wayne Haffenden Avatar answered Oct 20 '25 21:10

Wayne Haffenden