需要表明EF版本,如果你是vs2010或者vs2012的用户,你应该注意这一点
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/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>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
本文详细介绍了如何在Visual Studio 2010或2012中配置Entity Framework 6.0版本,以实现与本地数据库的连接。通过设置默认的连接工厂类型为LocalDbConnectionFactory,并指定数据库版本为v11.0,可以确保在指定的IDE环境下正确地使用EF进行数据库操作。

974

被折叠的 条评论
为什么被折叠?



