EF connection mysql data model of vs2013

Installed vs2013 first

Then install this version of mysql-installer-community-5.6.26.0.msi.

Then use gut to install the package on the project

Enter: Install-Package MySql.Data.Entity -Version 6.9.6

Why enter this package because:



You can see that the 6.9.6 connector is automatically installed when the 5.6.26 mysql is installed. So you have to install the EF 6.96 version of mysql in the project yourself.

Mr. Zhu's server is version 6.9.9. So use the computer manager to uninstall the 6.9.6 linker. Then install 6.9.9.

Then. [Clean up the solution] and then [Regenerate the solution], and there are

 <connectionStrings>
    <add name="DefaultConnection" conn-----------------------------ient" />-->

  <appSettings>

It's best to have none of the connections inside. Otherwise, it will also prompt. You are using the latest version.

After --- adding the model was successful.



And if you use [New item next time. If there is already a higher version of the connector]. Such as 6.9.8. The local computer can only use 6.9.6.

<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>

Change it to the following:

<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.6"></provider>

All 6.9.8 should be changed to 6.9.6. Then remove the 2 references to 6.9.8 (mysql.data.dll and mysql.data.entity.EF6). References to 6.9.6. Then [clean up the solution] [re-successful solution] and you're done~~~~~~! ! !

In use, if the table fields of the mysql database are changed. At this time, vs2013 will manually delete the table. If you update it again, if there is an error in the compilation. Or [clean solution] [regenerate solution]


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325729053&siteId=291194637