我使用VS 2013在c#中开发了一个应用程序。我的Windows 7桌面上的EntityFramework 6.0,运行时版本v4.0.30319
我可以使用SSMS连接到localdb。 当我输入sqllocaldb.exe info v11.0
时,我看到了这个Name: v11.0
Version: 11.0.3000.0
State: Running
代码:
using (var test = new myDataContextEntities())
{
var yy = from x in test.names select x;
Console.WriteLine(yy.ToList().Count);
}
在app.config中
<connectionStrings>
<add name="myDataContextEntities" connectionString="metadata=res://*/AnalysisModel.csdl|res://*/AnalysisModel.ssdl|res://*/AnalysisModel.msl;provider=System.Data.SqlClient;provider connection string="data source=(LocalDB)\\v11.0;initial catalog=Analysis;integrated security=True;Pooling=False;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<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>
问题:基础提供程序在ConnectionString上失败
我检查了4.02是按照建议安装的。 How can I find out if .NET 4.02 is installed?
答案 0 :(得分:0)
我认为在“provider connection string =”
之后你的字符无效