I’m trying out MySQL, and I’ve downloaded the Server, the connector, and the Query Browser. However, I only downloaded the older files, because the one currently shown on the website requires .NET 4.0, something I don’t want to put up with yet.
I’ve downloaded, specifically,
MySQL Database Server, 5.0.91, Windows Installer Format, 32 Bit
http://downloads.mysql.com/archives.php?p=mysql-5.0&o=-win
MySQL Connector, 5.0.7
http://downloads.mysql.com/archives.php?p=mysql-connector-net-5.0
and MySQL Query Browser and MySQL Administrator, 1.1.20 Windows Installer Format
http://downloads.mysql.com/archives.php?p=MySQLAdministrationSuite&o=-win
I’ve extracted the connector, and found a MySQL.Data.dll, as well as a MySQL.Data.Tests.dll
I copied them over to where my program is located and put it in Bin/Debug, and then made the reference to MySQL.Data.dll via Visual Studio (Browse). I was expecting the following code to work:
using MySQL.Data;
But it won’t. It returns a Namespace MySQL could not be found. Ugh. I then downloaded a .msi version of the connector, and tried to add it as a reference. It didn’t even appear in the .NET list.
Any ideas on why it won’t work? Thanks.
Just double-click the VS.Net reference. It’ll bring it up in the object explorer where you’ll see what namespaces are included therein. If you’re not seeing the namespace(s) you’re expecting then you’ve got the wrong DLL.
Also, you generally want to avoid putting external dependencies directly into the Bin. Place them outside the project and add-reference. In MySQL’s case, you probably don’t need to find the exact path to the DLL, it most likely shows in the “.Net” tab of the add-reference window after you’ve completed the MySQL install.