How to connect to a MySQL Data Source in Visual Studio

前端 未结 11 2069
忘了有多久
忘了有多久 2020-11-28 09:15

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

相关标签:
11条回答
  • 2020-11-28 09:55

    In order to get the MySQL Database item in the Choose Data Source window, one should install the MySQL for Visual Studio package available here (the last version today is 1.2.6):

    https://dev.mysql.com/downloads/windows/visualstudio/

    0 讨论(0)
  • 2020-11-28 09:56
    1. Download MySQL Connector .NET (6.9.4 on this date) from here and install it CUSTOM!
    2. Remove the ASP.NET WEB providers option or the installer will write in machine.config!
    3. Download MySQL for Visual Studio from here and install it CUSTOM. Be sure to check the integration options. You need this step because after Connector .NET 6.7 the installer will no longer integrate the connector with Visual Studio. This installer can take longer then expected. This is it.

    You can install it from alternate download here which should have integrated with VS correctly but it did not and I got a strange error and after the reinstall it is ok.

    0 讨论(0)
  • 2020-11-28 09:57

    unfortunately this is not supported in the builtin tools in visual studio. however, you can create your own data provider using mysql connector but still have to integrate it from code

    0 讨论(0)
  • 2020-11-28 09:59

    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.

    0 讨论(0)
  • 2020-11-28 10:00

    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

    0 讨论(0)
提交回复
热议问题