我是Entity Framework的新手,但是我似乎找不到连接字符串出了错的地方。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="ZzaDBContext" connectionString="data source=localhost; initial catalog=Zza; integrated security=True;App=EntityFramework;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
ZzaDBContext是我的DBContext扩展类,我连接到SQL Server的本地实例,数据库名称是Zza,并且通过Windows身份验证是不安全的。 对我来说,这似乎还不错,但我不断收到错误消息。