MySQL Connector/Net

This .NET Framework Class Library is provided by MySQL. The main functionality of the class library is contained in the file MySql.Data.dll.

Add a reference to the assembly MySql.Data and include the MySql.Data.MySqlClient namespace. Instantiate a new MySqlConnection connection object. Set the connection string and open the connection.

VB.NET code sample
Imports MySql.Data.MySqlClient
Dim myConnection As MySqlConnection = New MySqlConnection()
myConnection.ConnectionString = myConnectionString
myConnection.Open()
' execute queries, etc
myConnection.Close()
C# code sample
using MySql.Data.MySqlClient;
MySqlConnection myConnection = new MySqlConnection();
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
// execute queries, etc
myConnection.Close();

Description

Connector/NET enables developers to easily create .NET applications that require secure, high-performance data connectivity with MySQL. It implements the required ADO.NET interfaces and integrates into ADO.NET aware tools. Developers can build applications using their choice of .NET languages. Connector/NET is a fully managed ADO.NET driver written in 100% pure C#.

More info about this class library can be found at the MySQL product page.

Download

This .NET Framework Class Library, MySQL Connector/Net, can be downloaded here.

Connection Strings

The MySQL Connector/Net class library can be used to connect to the following data sources by using the following connection string references:

MySQL