Materials:
1. MySQL for Visual Studio 1.2.4.msi
Download: http://dev.mysql.com/downloads/windows/visualstudio/
2, Mysql-connector-net-6.8.3.msi
Download: http://dev.mysql.com/downloads/file.php?id=405442
EntityFramework.dll, MySql.Data.dll, MySql.Data.Entity.EF6.dll
Can be obtained through nugget to
3, VS2013 (FrameWork4.5)
Steps:
1, create a vs2013 project, import EntityFramework.dll, MySql.Data.dll, MySql.Data.Entity.EF6.dll
2, Tools-> extended and updated-> network search to “ Entity FrameWork Power Tools beta4“ , add this extension to vs 2013, restart vs.
3. Use code A to generate the EF codes used in the project.
4, install MySQL for Visual Studio 1.2.4.msi VS access MySQL driver. The data source options for "figure three" appear.
5. Install Mysql-connector-net-6.8.3.msi Connector
Click on the figure three OK button to appear:
6, Note: If the error, please check whether the introduction of the EF dll; is there a special character in the database field
7, Modify after the build is completed Config files.
Red Box One code:
<configSections>
<!--for more information on Entity Framework configuration, visit http://go.microsoft.c om/fwlink/? linkid=237468-->
<section name= "EntityFramework" type= " System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, version=6.0.0.0, Culture=neutral, publickeytoken=b77a5c561934e089 "requirepermission=" false "/>
</configSections>
Red Box Two code:
<entityFramework> <defaultconnectionfactory type= " System.data.entity.infrastructure.localdbconnectionfactory, entityframework "> <parameters> <parameter value= "v11.0" /> </parameters> </ Defaultconnectionfactory> <providers> < Provider invariantname= "MySql.Data.MySqlClient" type= "MySql.Data.MySqlClient.MySqlProviderServices, mysql.data.entity.ef6, version=6.9.7.0, culture=neutral, publickeytoken=c5687fc88969c44d " ></provider> </providers> </entityFramework> < System.data> <DbProviderFactories> < Remove invariant= "MySql.Data.MySqlClienT " /> <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.7.0, culture=neutral, publickeytoken=c5687fc88969c44d " /> </ Dbproviderfactories> </system.data>
8, configuration complete, write code test.