Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a reference to the MySQL connector for .NET?

Tags:

.net

mysql

What does this mean: Next add reference to: MySql.Data

actually I have downloaded mysql connector/net. by following these instructions:

First, you need to install the mysql connector/net, it is located at: http://dev.mysql.com/downloads/connector/net/1.0.html

Next create a new project

Next add reference to: MySql.Data

Next add "using MySql.Data.MySqlClient;" but im not able to install the connector.

website:http://bitdaddys.com/MySQL-ConnectorNet.html

like image 279
srinivas Avatar asked Jul 09 '09 07:07

srinivas


People also ask

How do I add references to MySQL in Visual Studio?

Once the MySQL Installations are done, restart Visual Studio 2019. Now, go to Solution Explorer. Right click on the project, click on Add and select the Reference. Click on MySql.

What is the MySQL Connector net?

MySQL Connector/NET enables you to develop . 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. You can build applications using your choice of .


1 Answers

"Add a reference to MySql.Data.dll" means you need to add a library reference to the downloaded connector. The IDE will link the database connection library with your application when it compiles.

Step-by-Step Example

I downloaded the binary (no installer) zip package from the MySQL web site, extracted onto the desktop, and did the following:

  1. Create a new project in Visual Studio
  2. In the Solution Explorer, under the project name, locate References and right-click on it. Select "Add Reference".
  3. In the "Add Reference" dialog, switch to the "Browse" tab and browse to the folder containing the downloaded connector. Navigate to the "bin" folder, and select the "MySql.Data.dll" file. Click OK.
  4. At the top of your code, add using MySql.Data.MySqlClient;. If you've added the reference correctly, IntelliSense should offer to complete this for you.
like image 71
Rob Avatar answered Sep 20 '22 18:09

Rob