baaroz
baaroz

Reputation: 19587

Storing Session in SQL Server on shared webhosting

I am trying to store session in SQL Server 2008 on shared webhosting. What I did until now is:

  1. run "InstallPersistSqlState.sql" against the database
  2. in the command line I made this script: aspnet_regsql -ssadd -sstype c -d SessionDb -sqlexportonly c:\SessionScript.sql (using aspnet_regsq.exe)
  3. run SessionScript.sql against the database.

Two tables were created (ASPStateTempApplications and ASPStateTempSessions) as well as all the necessary stored procedures.

My web.config file looks like this:

<sessionState
          mode="SQLServer"
          allowCustomSqlDatabase="true"
          sqlConnectionString="server;Initial Catalog=db;User ID=usr;Password=pwd"
          cookieless="false" timeout="20" />

finally when trying to run the site I an getting this error:

Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.

I checked everywhere on the internet but didnt find any solution that can help me with this problem.

Upvotes: 1

Views: 374

Answers (1)

Aaron Bertrand
Aaron Bertrand

Reputation: 280590

You need to contact the webhost - they will need to install ASPState for you (but I'll bet they won't do it). You may have to use InProc or another solution instead. Do you have multiple web servers, or just one?

Upvotes: 1

Related Questions