0

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=&quot;Data Source=<source>;Initial Catalog=<DB Name>;User ID=<User>;Password=<Password>;MultipleActiveResultSets=True&quot;" 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>
Rahul Parate
  • 219
  • 3
  • 15

2 Answers2

0

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.

<clear />
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=someserver;initial catalog=somedatabase;UID=someuser;PWD=somepassword;multipleactiveresultsets=True" providerName="System.Data.SqlClient"/>
Carl Prothman
  • 1,461
  • 13
  • 23
0

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.

  <providers> 

    <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DbEntities" applicationName="/" /> 

  </providers>

Just a suggestion, but you might want to consider using the new appfabric cache session state provider.

David Steele
  • 3,433
  • 21
  • 23