How to connect to a MySQL Data Source in Visual Studio

196,639

Solution 1

Visual Studio requires that DDEX Providers (Data Designer Extensibility) be registered by adding certain entries in the Windows Registry during installation (HKLM\SOFTWARE\Microsoft\VisualStudio\{version}\DataProviders) . See DDEX Provider Registration in MSDN for more details.

Solution 2

install the MySQL .NET Connector found here http://dev.mysql.com/downloads/connector/net/

alt text

Solution 3

"Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows."

Source: http://dev.mysql.com/downloads/connector/net/6.6.html

Solution 4

After a lot of searching and trying many solutions, I got it finally:

  1. uninstall connector

  2. uninstall MySQL for Visual Studio from control panel

    click here

  3. reinstall them according to the table below

    click here

  4. copy the assembly files from C:\Program Files (x86)\MySQL\MySQL Connector Net 6.9.8\Assemblies\v4.5 to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE

  5. log off and reopen your solution

  6. enjoy

Solution 5

This seems to be a common problem. I had to uninstall the latest Connector/NET driver (6.7.4) and install an older version (6.6.5) for it to work. Others report 6.6.6 working for them.

See other topic with more info: MySQL Data Source not appearing in Visual Studio

Share:
196,639
JohnB
Author by

JohnB

"The greatest shortcoming of the human race is our inability to understand the exponential function." Dr. Albert Bartlett

Updated on June 20, 2020

Comments

  • JohnB
    JohnB almost 4 years

    I use the MySQL Connector/Net to connect to my database by referencing the assembly (MySql.Data.dll) and passing in a connection string to MySqlConnection. I like that because I don't have to install anything.

    Is there some way to "Choose Data Source" in Visual Studio 2010 without installing something?

    How can I get a MySQL option (localhost) to show up on one of these lists? Or do I have to install something?

    (I don't want to use ODBC btw)

    "Add Connection" from Server Explorer: alt text

    Entity Data Model Wizard: alt text

  • JohnB
    JohnB over 13 years
    Thanks, but I am familiar with the link to that driver!
  • Lucas
    Lucas over 13 years
    @JohnB then what's the problem? f00's screenshot shows that MySql appears as an option in the "Choose Data Source" dialog.
  • JohnB
    JohnB over 13 years
    @Lucas, no I get that, my question was whether is was possible to Add a Connection through the Server Explorer by just using the MySql.Data.dll assembly. @f00: +1 for your help.
  • JohnB
    JohnB over 13 years
    Any examples on how to use my own data provider to create ASP.NET Reports? All the examples I have seen use the built in wizards/tools.
  • Lucas
    Lucas over 13 years
    @JohnB Oops, I misread, though you meant it didn't show up for you. I'll add an answer with details, for future reference :) and +1 f00
  • mkataja
    mkataja over 10 years
    Had a similar experience. MySQL wouldn't show in the Data Sources list using Connector/NET 6.7.4. Version 6.6.5 was fine though.
  • Subby
    Subby over 10 years
    THANK YOU MKATAJA AND SERGIO!!!!!!! Uninstalling my current MySQL Connector from Control Panel, installing 6.6.6, relaunching VS worked perfectly! Thank you!!
  • stuzor
    stuzor about 10 years
    See my post below - it seems you may need to install older drivers for VS2010!!
  • Fernando Gonzalez Sanchez
    Fernando Gonzalez Sanchez almost 10 years
    Starting version 6.7, Visual Studio integration was splitted into a different product, MySql for Visual Studio, see dev.mysql.com/downloads/windows/visualstudio
  • KidBilly
    KidBilly over 9 years
    Thanks! I installed the most recent version of SqlConnector and it didn't work for VS2010. Installed 6.6.6, and success!
  • konrad_pe
    konrad_pe about 8 years
    Confirming this to work for Visual Studio 2015 aswell!
  • Luke Dupin
    Luke Dupin about 7 years
    You're my hero!
  • Akhil
    Akhil almost 6 years
    hi friend i installed 1.2.7 which is compatible with visual studio 2017
  • Jordan
    Jordan almost 6 years
    Clicking the arrow up would be the best praise.
  • Chesare
    Chesare over 4 years
    I did the same, along with the standalone installer for VS (dev.mysql.com/downloads/windows/visualstudio), restart Visual Studio 2017 and there were the driver ready to use. It did not appear on VS2019, though.
  • wodzu
    wodzu over 4 years
    I was missing the second installer for VS2019: "MySQL for Visual Studio".
  • Boomerang
    Boomerang over 3 years
    Work for Visual Studio 2019