views:

17632

answers:

11

Does any one know how to connect to MySQL 5.1 with Visual Studio 2010?

I have already tried the MySQL Connector/ODBC route and it got me really nasty results. The table rows were all listed as a view in the views section and nothing at all was listed in the tables or procedures folder.

+1  A: 

Erm... through code? Or do you mean the server explorer add-in? Have you tried the latest (albeit GPL-ed) connector version for .NET from Mysql themselves? Again, it's GPL-ed so be aware of the consequences of using that for your own software.

Frans Bouma
i'm lazy. i was hoping to do this through the server explorer addin. i have tried the .net connector and visual studio 2010 doesn't seem to pick it up. there is something wrong with the installation methinks.
jake
+3  A: 

http://bugs.mysql.com/bug.php?id=45122

I got this to work, see my answer below
Christian Payne
+1  A: 

Microsoft Visual Studio 2010 Beta 2 is busted for DDEX providers. They are auto promoting a VS 2008 assembly from 9.0 to 10.0 and it fails. The failure has to do with the fact that a .NET 2 assembly cannot load a .NET 4 assembly.

This worked in beta 1, so it is something they broke.

I even went back and tried the reference DDEX provider from the SDK. It won't load in VS 2010 beta 2 either. That tells me they have something that needs to be fixed.

When is the next beta?

Jason Short
A: 

The next Beta ought to be the RTM ;-)

On topic:

no solution for the problem :(

Montago
A: 

Yesterday, I downloaded / installed Visual Studio 2010 Beta 2 ... created a new connection ... and I see something in VIEWS and PROCEDURES ... and that's it.

larsmith217
A: 

As of the drop of the VS2010 Release Candidate, this is still broken.

Jarrett Meyer
A: 

Any updates? I have been able to install the odbc driver and use that in VS 2010. I can retrieve data and see it in the server explorer. But it wont allow me to add my database as a project data source because its looking for .DUAL which doesnt exist... anyone have similar problems?

Diggity
A: 

EDIT: its looking for [databasename].DUAL which doesn't exist.. had the other one in <> tags and it disappeared.

Diggity
+8  A: 

this seems to solve the issue

UPDATED LINK TO LATEST RELEASE THANKS @Christian Payne

Update: looks like there is already a non-beta!!!!

http://www.mysql.com/downloads/connector/net/

Luiscencio
I had problems installing the alpha. You must get rid of empty Config folders for your .NET framework installations before running the MySQL installer, as described here: http://forums.mysql.com/read.php?38,354259,363768#msg-363768Go to your Framework Folder: For x64 C:\Windows\Microsoft.NET\Framework64\ For x86 C:\Windows\Microsoft.NET\Framework\ For each folder inside there check if existis a folder with the name "Config" Then if the folder 'Config' is empty DELETE THIS FOLDER; After checking all folders Re-run the Installer.
ThisIsTheDave
This helped as well: http://forums.mysql.com/read.php?38,354259,358381#msg-358381
Christian Payne
This worked, thanks!
BigJoe714
This updated link is to the source code, not the installer. You will need to compile this first or download the msi - http://dev.mysql.com/downloads/mirror.php?id=389424
Christian Payne
+2  A: 

As someone else suggests..

http://dev.mysql.com/downloads/mirror.php?id=382641

..fixes the problem.

I had v6.2.3 installed after I had vs2010 installed and the MySQL driver was not shown in the list of the Database Connect dialog. I wrongly assumed I should use the .NET ODBC drivers instead and it caused all sorts of problems. Although I could easily connect to the DB using codebehind, the server explorer wouldn't connect to the DB.

Luckily after uninstalling 6.2.3 and installing 6.3.0 (from the link above) the MySQL driver was added to VS2010, and I was able to connect to the database and see it in my server explorer.

ricp
Worked for me, Thanks.
Kevin
+7  A: 

To get the Entity Frame working with VS2010, I had to do the following:

  1. This only worked with Mysql .net Connector v6.3.1 (alpha). Previous versions ignored VS 2010 (click Development Releases)
  2. I had to rename my Framework\v1.1.4322\CONFIG folder. Otherwise the install will fail. Rename it back when finished

(I've blogged about this here)

Update 6.3.2 is in beta and I can confirm this works. (I didn't need to rename the framework folder)

Christian Payne
+1: This worked for me. The other approach about deleting empty config dirs didn't work for me.
Jimmy
I can only see 6.3.2 beta on the site now, and it will not install with the CONFIG directory renamed. I also tried renaming the v2 CONFIG dir, but Windows wouldn't let me do it. Still looking for a MySQL connector for VS2010 that works (and is free).
DaveN59
Correct URL for the 6.3 beta version http://dev.mysql.com/downloads/connector/net/6.3.html(6.3.2 appears to be the current version)
matthew.perron