Data Provider does not have the. NET Framework Data Provider for Mysql workaround

Source: Internet
Author: User
Tags microsoft sql server mssql server

In a recent project, the database uses MYSQL, while the project uses the Entity data Model to do the service layer
, but when adding the Data entty Model to the project, we usually choose to generate it directly from the database, but in the selection
Data Provider, there is no. NET Framework Data Provider for Mysql, the default is only one

. NET Framework Data provider for SQL Server, this can only be connected to Microsoft SQL Server or MSSQL server, if and Mysql connection error, next from the database generated number According to the entity this step can not do, work progress on the card in this, query a lot of information, toss for a day or two, the problem is finally solved, can sacrifice is time and efficiency, so have this blog, but also their own to this period of summary. Well, not much to say, below I put the specific steps listed, at the same time with:

Right-click in the project to add a new item:

2. Select data--> ADO Data model

3. Select Generate model from database

4. Select a data source

But in this step, the original data provider only Jane on the NET Framework Data provider for SQL Server, that NET Framework Data provider for MySQL is my own add Go in, down is water. Add the NET Framework Data provider for MySQL key step:

Download and install: mysql-installer-community-5.6.21.1

Modify the following files at the same time:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config file

<system.data>
<DbProviderFactories>

<add name= "MySQL data Provider" invariant= "MySql.Data.MySqlClient" description= ". Net Framework Data Provider for MySQL "Type=" MySql.Data.MySqlClient.MySqlClientFactory, Mysql.data, version=6.9.5.0, Culture=neutral, Publickeytoken=c5687fc88969c44d "/>
</DbProviderFactories>
</system.data>

PublicKeyToken according to their own MySql.Data.MySqlClient version number to determine, here I use the official network of the latest 6.9.5.0

Restart the project and re-add the data entity model

This will be OK, the problem has finally been resolved

Data Provider does not have the. NET Framework Data Provider for Mysql workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.