views:

280

answers:

2

How we have to store session state in database??? Is there any configuration to store the Session & Application variables in SQL Server 2005 database.

+2  A: 

Assuming you mean in asp.net (if you don't remove the tag I just added) then follow these instructions

blowdart
I run this command on command promt OSQL -S SQLEXPRESS -E <InstallSqlState.sqlGetting error [SQL Native Client]Named Pipes Provider: Could not open a connection to SQLServer [53].[SQL Native Client]Login timeout expired[SQL Native Client]An error has occurred while establishing a connection tothe server. When connecting to SQL Server 2005, this failure may be caused bythe fact that under the default settings SQL Server does not allow remoteconnections.How i run that script???? I have not query analyzer.
blowdart
Can u suggest me how can i do the same through oracle.
Then it sounds like you've bodged up the install somewhere. If you're determined to waste time storing state in SQL Express on a single server then I suggest you uninstall MSE and SQL Express 2005 then start again using the SQL Express with Advanced Services which includes MSE - http://www.microsoft.com/Sqlserver/2005/en/us/express-down.aspx
blowdart
I am using SQL Server Express for experimental purpose only.I want to use Oracle database for state management. Can you suggest some good tutorial for using oracle database for state management?
I don't know if Oracle even provide a state provider.
blowdart
+1  A: 

By default, session state values and information are stored in memory within the ASP.NET process. Alternatively, you can store session data in a SQL Server database, where it can be shared by multiple Web servers. For more information about session state, see Implementing a Session-State Store Provider and Session-State Modes.

If the database that you specify for session state with Aspnet_regsql.exe does not already exist, then the current user must have rights to create databases in SQL Server as well as to create schema elements within a database. If the database does exist, then the current user must have rights to create schema elements in the existing database.

To install the session state database on SQL Server, run Aspnet_regsql.exe tool supply the following information with the command:

  • The name of the SQL Server instance, using the -S option.

  • The logon credentials for an account that has permission to create a database on a computer running SQL Server. Use the -E option to use the currently logged-on user, or use the -U option to specify a user ID along with the -P option to specify a password.

  • The -ssadd command-line option to add the session state database.

By default, you cannot use Aspnet_regsql.exe to install the session state database on a computer running SQL Server 2005 Express Edition. For more information about using SQL Server 2005 Express Edition to store session state, see Session-State Modes.

From here: ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)

Mitch Wheat
I run this command at VS command promt aspnet_regsql.exe -S localhost -E -ssadd it gives error THe argument -ssadd is invalid.what i do??