0

I want to know if I have sqlstate session then do I need to create database for aspnetdb in the already (i.e. sampledb) existed database or I should have to create it separately. Suppose if I had create it in sampledb which is already existed then what connection-string path should I have to give in web.config and what changes would I have to make it on the time of deployment of the internet.

Please give me answer because there is lots of questions arising in my mind.

1 Answer 1

1

You should create a new database for the session state.

Configuring SQL Server session state is really simple and requires two simple steps:

  1. Install ASPState database on your SQL server.

    1.1 Open the command prompt and navigate to the folder where .NET Framework is installed on your machine e.g. C:\Windows\Microsoft.NET\Framework\v4.0.30319

    1.2 Run the following command in the command prompt - aspnet_regsql.exe -S SampleSqlServer -E -ssadd -sstype p

  2. Configure SQL server session state in the Web.config file to point to the ASPState database on your server.

Web.config:

<configuration>
  <system.web>
    <sessionState mode="SQLServer"
      sqlConnectionString="Integrated Security=SSPI;data 
        source=SampleSqlServer;" />
  </system.web>
</configuration>

Complete tutorial can be found here - Session-State Modes

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.