17

I want to use ADO.NET with MySQL, so I’ve installed MySQL Connector and MySQL for Visual Studio:

MySQL Installer window with MySQL Server 5.6.23, MySQL Workbench 6.2.4, MySQL Notifier 1.1.6, MySQL for Visual Studio 1.2.3, Connector/NET 6.9.5 and MySQL Documentation 5.6.23, all for X86 architecture

(I use Visual Studio 2015 and Windows 10) When I create a new ADO.NET, I don’t have MySQL:

EDM Assistant window with connection choice window

I don’t know how I can get MySQL to work with Entity Framework… I followed a tutorial, but it doesn’t work.

Community
  • 1
  • 1
  • 1
    *but it dosent work* can you elaborate? – Izzy Mar 23 '15 at 10:00
  • I havent MySQL in my DataSource, so this tutorial dosent work ^^ I dont know how can i fix this sh**... ! I have the same screen :/ –  Mar 23 '15 at 10:01
  • 1
    Have a look [here](http://stackoverflow.com/questions/21206184/cant-use-a-mysql-connection-for-entity-framework-6) – Izzy Mar 23 '15 at 10:04
  • Nop again, i havent MySQL DataSource : http://puu.sh/gM6ng/0e137a844e.png –  Mar 23 '15 at 10:11
  • I just downloaded Visual Studio 2013, and it work fine, i think it just VS2015 because its a preview... –  Mar 23 '15 at 12:55
  • MySql Connector does not support VS2015 yet. It will work on VS2013. – Bill Cheng Apr 28 '15 at 01:22
  • Same issue here. According to [this](https://stackoverflow.com/a/31520607/382515) I changed Framework from 4.5.2 to 4.5 and it worked. What a pain to find it! – Ivan Ferrer Villa Jan 30 '18 at 09:43

7 Answers7

7

From this release: http://dev.mysql.com/doc/relnotes/mysql-for-visual-studio/en/visual-studio-news-1-2-4.html it is possible.

In fact, I followed, and installed MySQL connector for Visual Studio 2015 correctly: http://dev.mysql.com/downloads/windows/visualstudio/

Dejan Rajic
  • 121
  • 1
  • 6
3

At the moment it is not possible. See info posted about EF 7 - Beta 4:

What’s Next

[...]

Providers

There is work underway to enable the following database providers. We’ve also had contact with many other providers who are planning to provide EF7 support.

  • SQLite (being developed by the EF team)
  • PostgreSql (being developed by the npgsql team)
  • MySql (being developed by the MySql team)
PHeiberg
  • 29,411
  • 6
  • 59
  • 81
Stephan
  • 31
  • 2
  • 1
    Providers There is work underway to enable the following database providers. We’ve also had contact with many other providers who are planning to provide EF7 support. •SQLite (being developed by the EF team) •PostgreSql (being developed by the npgsql team) •MySql (being developed by the MySql team) – Stephan May 05 '15 at 15:01
  • @PHeiberg I get that its still in beta so there for not ready yet. But the connector is not getting registered with vs2015 for some reason. So I cant even use it with EF 6 – Florian Schaal Dec 16 '15 at 08:48
3

This combination finally worked for me:
MySQL for Visual Studio - v1.2.6
MySQL Connector/Net - v6.9.8
(Visual Studio 2015 Community and Windows 10)

Solution Reference: MySQL Forumn - "Can't Create Datasource on VS2015"

Stephen C
  • 731
  • 11
  • 11
2

You should use NuGet package for MySQL For Entity Framework

In Visual Studio 2015:

  • Tools
  • Nuget Package Manager
  • Manage NuGet Packages for Solution

Search for MySQL and install the desired one.
Rebuild and its ready

pojomx
  • 780
  • 2
  • 11
  • 24
2

I've been stuck with this issue many days I tried to install MySQL tool for Visual Studio from here

Everything is working now, Goodluck

Kulpemovitz
  • 531
  • 1
  • 9
  • 23
0

Just use the old way:

 var factory = DbProviderFactories.GetFactory(providerName);
 var conn = factory .CreateConnection();
 conn.ConnectionString = connectionString;
 var cmd = factory .CreateCommand();
 cmd.Connection = conn;
 cmd.CommandText = cmdText;
 .....

Of course put it all inside using, etc

Here is my provider and connection string

providerName = "MySql.Data.MySqlClient"
connectionString= "Server=localhost;Uid=root;Pwd=123456;Database=world;CharSet=utf8mb4"

I used Visual Studio 2015 RC Version 14.0.22823.1 D14REL, MySQL.Data Version 6.9.6.0, Windows 8.1 x64 Enterprise

Vitaly
  • 2,064
  • 19
  • 23
0

Had same problem but solved it

  • by running odbcad32.exe in windows\system32 directory and
  • Adding MySQL ODBC 5.3 ANSI Driver and
  • then pick Data Source in VS2015 .NET Framework Data Provider for ODBC
soumya
  • 3,801
  • 9
  • 35
  • 69
gregiolo
  • 115
  • 1
  • 5