andrew slaughter
andrew slaughter

Reputation: 1117

asp.net 4 store session state on remote sqlserver

Im trying to find a complete tutorial that will show me how to configure my asp.net 4.0 application to store sessions on a remote sqlserver 2005 db

can anyone help

thanks

Upvotes: 1

Views: 1193

Answers (1)

Aristos
Aristos

Reputation: 66641

The steps you need to take.

  1. Setup the remote server with the SQL server
  2. On the remote server you run the script of asp.net that creates the session database
  3. You allow on remote server connections from other computers on sql, and you also add on the firewall rules that allow that connection.
  4. Finally you setup on the web.config the connection on the remote server.

The web config must contains the connections as:

<connectionStrings>
    <add name="SqlState" connectionString="Data Source=111.111.111.111;DataBase=SessionState;User ID=sa;Password=***" providerName="System.Data.SqlClient" />
</connectionStrings>

and

<sessionState mode="SQLServer" sqlConnectionString="SqlState" allowCustomSqlDatabase="true" cookieless="false" timeout="20" />

How you setup the session state on remote computer:
http://msdn.microsoft.com/en-us/library/ms229862(VS.80).aspx

http://blogs.msdn.com/b/akshayns/archive/2008/10/04/how-to-configure-sql-server-to-store-a-session-state.aspx

http://support.microsoft.com/kb/317604

Upvotes: 1

Related Questions