Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Data Provider Not Showing in Entity Data Model Wizard

I am creating an MVC application with MySQL as backend. I am planning to use Entity Framework to work with this database. I already have a database so need to generate models from a database

Environment:

MySQL Server 5.7.21 MySQL for Visual Studio 1.27 Connector/NET 6.10.5 Visual Studio 2015

To Reproduce Issue:

Step 1: Add new item 'Ado.net Entity Data Model' Step 2: Selected 'EF Designer from database' and click 'Next' Step 3: Clicked 'New Connection'

There is no mysql connector available.

Other Details:

  1. I already added "System. Runtime" deal as it shows error when installing Mysql. data. Ef6 from nugget
  2. I changed "CopyLocal= true" in 'System. Data' assembly reference
  3. I tried the same steps in Visual Studio 2017. Here I can see the provider in the step 3 but after click ok dialogue closed instead of showing table list

In Visual Studio 2015 and 17 initial time it shows the provider. when I tried next time it's not displaying Please help. I am checking this for 2 days

like image 288
Akhil Avatar asked Feb 01 '18 10:02

Akhil


People also ask

Does Entity Framework support MySQL?

1 Creating a Database with Code First in EF Core. The Code First approach enables you to define an entity model in code, create a database from the model, and then add data to the database. MySQL Connector/NET is compatible with multiple versions of Entity Framework Core.

How do I add ado net entity data model?

Create the ADO.NET Entity Data ModelRight-click on your project in the Solution Explorer window and select the menu option Add -> New Item. In the Add New Item dialog, select the Data category. Select the ADO.NET Entity Data Model template, give the Entity Data Model the name Northwind. edmx, and click the Add button.

What is a data model entity?

The Entity Data Model (EDM) is a set of concepts that describe the structure of data, regardless of its stored form. The EDM borrows from the Entity-Relationship Model described by Peter Chen in 1976, but it also builds on the Entity-Relationship Model and extends its traditional uses.


1 Answers

To start working with VS 2013 and EF 6

  1. Install the MySQL for Visual Studio 1.1.1
  2. Install the Connector/Net 6.8.1 product.
  3. To work with Database first please do the following
    • Add the reference for the new assembly called MySql.Data.Entity.EF6 and copy it to the bin forlder of your application.
    • Add the provider to your app/web config file on the providers for Entity Framework section with the following line:
    • Before you run the Wizard compile your application so the new changes are applied.
  4. To work with Model First please do the following
    • Add the reference for the new assembly called MySql.Data.Entity.EF6 and copy it to the bin forlder of your application.
    • Add the ADO.Net Entity Model new or existing.
    • Select the T4 template corresponding to MySQL (SSDLToMySQL)
    • Right click on the model and then select Generate Script to Create Database. (A MySQL script should be generated for you to create your database).

Hope this helps a bit.

MySQL for Visual Studio 1.1.1

MySQL Connector/Net 6.8.1 Beta

like image 95
Benjamin RD Avatar answered Oct 12 '22 00:10

Benjamin RD