Adding MySQL.Data as a Reference in Visual Studio Ultimate 2010
Asked Answered
C

5

15

I'm creating a new C# project. I want to connect it with the MySQL server. When I click Add Reference, MySQL.Data is not shown. This leads to all sort of problems because I can't connect it with my database.

I'm using Visual Studio Ultimate 2010 and MySQL 5.5.

Please help.

Thanks

Contravene answered 21/6, 2011 at 9:14 Comment(1)
been patched apparently: bugs.mysql.com/bug.php?id=44141Substance
C
21

MySQL isn't available "out of the box" in .NET.

You need to download the class library, and then add a reference to the class library once you've unpacked the zip file. In the "Add Reference" dialog box, go to the "Browse" tab (if I remember correctly) so that you can find the class library.

Corkwood answered 21/6, 2011 at 9:17 Comment(4)
For me on windows 7 64-bit the DLL is found at C:\Program Files (x86)\MySQL\MySQL for Visual Studio 1.2\Assemblies\v4.0\MySql.Data.Entity.dll once I did 'Add Refefrence' from solution explorer and browsed there as Jon Skeet suggested it works.Chandelle
Is it 32-bit only?Extract
@JackWright: See sjduan's answer. And if that doesn't help, please ask a new question - anything from 10 years ago is unlikely to still be up-to-date.Corkwood
Hi Jon, your answer helped me and your response being 10 years old doesn't matter. Today's 2021 page still shows 32-bit downloads. Nevertheless, I did find the answer and it still seems to be the case that 32-bit is the only way.Extract
B
13

The MySql.Data dll is stored in:

Code:

C:\Program Files\MySQL\MySQL Connector Net \Assemblies

In the references window, choose the option to browse to the assembly directly.

Bagwell answered 13/2, 2012 at 14:50 Comment(1)
Until a 64-bit version is available, on 64-bit systems, the path is C:\Program Files (x86)\MySQL\MySQL Connector Net [x.x.x]\Assemblies\v[Y.Y]\ - where [x.x.x] and [Y.Y] are to be replaced by version numbers.Roughandready
M
4

If you install MySQL for Visual Studio with VS 2010 I found it here:

Add Reference > Browse > C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\MySql.Data.dll

Modulus answered 31/7, 2014 at 2:54 Comment(0)
T
1

You need to download the MySql Connector for dotnet. Once you have downloaded it, just install it. Then go to your project: i. Right click on the project and choose add -> Reference browse for the MySql.Data and select it to add. Reference is added now just include the following statement on top of your program file using MySql.Data.MySqlClient

You are then good to go

Titivate answered 7/10, 2015 at 7:20 Comment(0)
I
0

first installed the MySQL Installer 8.0.35 in windows 10 and the went to the folder "C:\Program Files (x86)\MySQL\MySQL Connector NET 8.2.0" and copied the DLL file(MySql.Data.dll) to "bin" folder of my visual C++ application and it worked for me , hope it helps some one.

Intrepid answered 1/11, 2023 at 12:3 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.