Asp.net 通用提供程序错误
我已经安装了 asp.net 通用提供程序,但更改配置后出现错误“EF 提供程序需要 MultipleActiveResultSets=True for System.Data.SqlClient 连接字符串”
我也更改了
下面的 连接字符串我的连接字符串和 web.config 的会话块请帮助我
<add name="DbEntities" connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=System.Data.SqlClient;provider connection string="Data Source=<source>;Initial Catalog=<DB Name>;User ID=<User>;Password=<Password>;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
<add name="StorageConnectionString" connectionString="DefaultEndpointsProtocol=http;AccountName=<Account Name>;AccountKey=<Account Key>" />
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="StorageConnectionString" applicationName="/" />
</providers>
</sessionState>
i have installed asp.net universal providers, but after changing the configuration i am getting error "EF Providers require MultipleActiveResultSets=True for System.Data.SqlClient connection strings"
i have changed the connection string also
below is my connection string and session block of web.config please help me
<add name="DbEntities" connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=System.Data.SqlClient;provider connection string="Data Source=<source>;Initial Catalog=<DB Name>;User ID=<User>;Password=<Password>;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
<add name="StorageConnectionString" connectionString="DefaultEndpointsProtocol=http;AccountName=<Account Name>;AccountKey=<Account Key>" />
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="StorageConnectionString" applicationName="/" />
</providers>
</sessionState>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你已经基本明白了,只犯了一个小错误。当您添加会话状态提供程序时,它应该指向您的 SQL 连接字符串而不是存储连接字符串。
只是一个建议,但您可能需要考虑使用新的 appfabric 缓存会话状态提供程序。
I think you have pretty much got it with only one tiny error. When you add the session state provider it should point to your SQL Connection string not your storage connection string.
Just a suggestion, but you might want to consider using the new appfabric cache session state provider.
耶!我成功了!
当将 ASP.NET 通用提供程序部署到另一台机器上带有 SQL Server 的远程 Web 计算机时,需要“删除”主 web.config 中的 LocalSqlServer 连接,然后拥有一个虚拟 LocalSqlServer Web 项目 web.config 中的连接字符串。例如
Yay! I got it working!
when one deploys the ASP.NET Universal Providers to a remote Web machine with SQL server on a different box, one needs to "remove" the LocalSqlServer connection in master web.config, and then have a dummy LocalSqlServer connection string in the web project web.config. e.g.