To configure how EF links SQL Server
Materials:
1, Entity Framework version: 6.0 + (EntityFramework.dll, EntityFramework.SqlServer.dll) (You can use nugget to get the latest version of EntityFramework)
2, VS2013 (FrameWork4.5)
Steps:
1. Create a project and then introduce the 2 DLLs of the Entity framework.
2, tool-> extension and update-> network search to "Entity FrameWork power Tools Beta4", add this extension to VS2013, restart vs.
3. Use code A to generate the EF codes used in the project.
4, after the creation of the config file modified.
Red Box One
<configSections>
<section name= "EntityFramework" type= " System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, entityframework "requirepermission= false"/>
</configSections>
Red Box Two
<entityFramework>
<defaultconnectionfactory type= " System.Data.Entity.Infrastructure.SqlConnectionFactory, entityframework ">
<parameters>
< Parameter value= "v11.0"/>
</parameters>
</defaultConnectionFactory>
</entityfram Ework>
5, Note: If the error, please check whether the introduction of the EF DLL; Is there a special character in the database field
6, configuration complete, write code test.