Reputation:
I want to use ADO.NET with MySQL, so I’ve installed MySQL Connector and MySQL for Visual Studio:
(I use Visual Studio 2015 and Windows 10) When I create a new ADO.NET, I don’t have MySQL:
I don’t know how I can get MySQL to work with Entity Framework… I followed a tutorial, but it doesn’t work.
Upvotes: 17
Views: 34539
Reputation: 791
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"
Upvotes: 3
Reputation: 113
Had same problem but solved it
odbcad32.exe
in windows\system32 directory andMySQL ODBC 5.3 ANSI Driver
and VS2015 .NET
Framework Data Provider for ODBCUpvotes: 0
Reputation: 541
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
Upvotes: 2
Reputation: 31
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)
Upvotes: 3
Reputation: 790
You should use NuGet package for MySQL For Entity Framework
In Visual Studio 2015:
Search for MySQL and install the desired one.
Rebuild and its ready
Upvotes: 2
Reputation: 121
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/
Upvotes: 7
Reputation: 2135
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
Upvotes: 0