Using SQL Server for Session State Management - Custom Location for Connection String

Hello,

We are implementing session management in a custom database, provided by the following sessionState configuration in web.config:

<sessionState mode="SQLServer" stateConnectionString="" 
   allowCustomSqlDatabase="true"
   sqlConnectionString="Data Source=serverName;Database=databaseName;User Id=userName;Password=password"
   cookieless="false" timeout="60"

/>

For reasons to complicated to go into, our company imposes standards on how/where database connection strings get stored. Is there an attribute or method by which I could point to an external source for the connection string (e.g. say, if it were located in the windows registry?).

 Note, the application under discussion is ASP.NET 1.1

0
kckriegs
3/26/2007 4:02:24 PM
asp.net.state-management 8807 articles. 0 followers. Follow

4 Replies
1597 Views

Similar Articles

[PageSpeed] 50
Get it on Google Play
Get it on Apple App Store

Here you go:

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

You can use this link to encrypt the connectionstring and store the encrypted result in the registry.


The programmer's national anthem is 'AAAAAAAARRRRGHHHHH!!'.
0
Rivarolle
3/26/2007 8:17:15 PM

Excellent suggestion! Though kind of a roundabout way to solve my problem. Sounds like I have to encrypt the connection string in order to put it where I want in the registry?

...Or does the  aspnet_setreg.exe tool allow for a non-encrypted option?

0
kckriegs
3/26/2007 9:45:25 PM

I don't think that aspnet_setreg.exe can allow non-encrypted data (never tried to use it without encryption).

If you want to store the connection string non-encrypted in the registry, you could add an appsettings in web.config like this:

<appSettings>
<add key="ConnString" value="registry:HKLM\SOFTWARE\Intranet\ProjectTrackingCon figuration,ConnectionString" />
</appSettings>

and then load it in the Application_OnStart Event Handler (Global.asax)

Hope this helps


The programmer's national anthem is 'AAAAAAAARRRRGHHHHH!!'.
0
Rivarolle
3/27/2007 2:25:16 AM

Hmm...are you illustrating some ASP.NET registry lookup syntax I've not seen before...

or are you recommending that my Application_OnStart Event Handler parse the "ConnString" value and do a registry lookup for the appropriate key/value using the RegistryKey object?

If it's an ASP.NET syntax which automatically does a registry lookup for an appSetting, that would be COOL. But I can't get it to work.

0
kckriegs
3/27/2007 8:42:21 PM
Reply:

Similar Artilces:

This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers
When I connect SQL Server 2005 to a remote database i get the error: "This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers". Can I confirm it is because: the remote db is of SQL Server 2008? There is a soln mentioned in http://forums.asp.net/t/1324047.aspx Did anybody try this (installing 2008 express: http://www.microsoft.com/express/sql/download/)? I am just checking again, whether it will disturb my existing SQL Server installation, in any means...? Though it is mentioned that it will g...

how to use state server to manage sessions
How does one use the state server? Can anyone explain the process how the state server is used or give me some links to which I can refer to, which will explain the same? Basically, we have a web farm environment and we need to persist data across the web farm, for which we intend to use the state server Hi, on the server where State Server will be running, on Services just start the "ASP.NET State Service" service. Then on web.config <sessionState> element in web apps change the mode attribute to "StateServer" and check that stateConnectionString attri...

Unable to use session state server....requires session state server version 2.0 or above.
So, I have Windows 2003 IIS latest service packs running. Its running .NET 2.0 and .NET 1.1 applications in seperate application pools. Just today I applied the following patch to the server. (The server is not running any 3.0 or 3.5 applications or application pools)  Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x86 Microsoft .NET Framework 3.5 Service Pack 1 is a full cumulative update that contains many new features building incrementally upon .NET Framework 2.0, 3.0, 3.5, and includes cumulative servicing upda...

Session on End event if using state server or sql server
The documentation for 'Session_OnEnd' indicates that it not invoked if the session is stored in sql server or state server. Any workarounds to capture Session_OnEnd if the session is maintained in state server or sql server? Thanks in advance. I solved in the following way.The approach is in check for the new / existing session on each request at global.asax.Here is the simple work around private void Application_PreRequestHandlerExecute(Object sender, EventArgs e){        if (Context.Session != null)     &n...

Session management
Hi, We are planning to use state server for maintaining session in our application since we are going for web farm installation. Could anyone please clarify the following queries 1) Assume we are installing our application in server 1 and server 2. Should I run state service in both the servers. Or there is an option of running service in Server 1 and point server 1 and server 2 to the service running in server1? 2) Somewhere in the article I read to maintain session variables all the pages in the application should be in one directory only. Is that true? If it is true how do we mainta...

SQL Server state management
Hi,I have a quick question regarding retrieving data from the ASPStateTempSessions table.Is it possible to get the SessionItemShort and/or the SessionItemLong column for a given SessionId and deserialize the data? Thanks. ...

Session_End Event in global.asax is not exeuting when the session state mode is state server or sql server
Hi, The code written in global.asax file Session_End()  Method is not executing when the session state mode is state Server Or sqlserver. can any body please suggest me how can i trap the seesion_end Event when the mode is state server.            You cannot.  Only when your session state is set to InProc will that event fire.  This is by design. The other 2 modes represent out of process (and possibly off-box) services that do not have the ability to raise events inside of your app.  Mike Banavige~~~~~~~~~~~~Need a site code s...

You must use SQL Server 2005 management tools to connect to this server
Hello, After installing SQL Server 2005, I get a message stating "You must use SQL Server 2005 management tools to connect to this server", while trying to connect to my localhost using SQL Server 2000 Enterprise Manager. Regards, junior What are you trying to do, view a database, view a website?Johan TheunissenMCPD, MCSE, MCTS BizTalk 2006==============================Please mark the most helpful reply/replies as "Answer". I am trying to connect wiht the datbase.  thanks,  junior Use server explorer in Visual Studio.Johan TheunissenMCPD, MCSE, MCTS BizTal...

Using session management without SQL server agent (SQL Express)
Hi, I'm using session management but as using SQL Express so the deleteexpiredsessions stored procedure does not automatically run.  I have it run automatically from the master page, but the session is update before the stored procedure runs. If I manually execute the stored procedure from SQL Express then it deletes the session like it should do.  Am I able to manually run the stored procedure to remove old sessions somewhere (obviously not page_load!), or do I have to have the SQL server agent? Thanks, Ricky (Once the site is hosted, the hosts support SQL server 2005 so...

Can I use SQL 2005 Management studio to connect to SQL 2000 server?
Hi,Can I use SQL 2005 Management studio to connect to SQL 2000 server?   You certainly can!I only use SQL 2005 Management Studio for accessing all my 2000/2005 instances/databases. ...

SQL Server State Management on Load Balanced Servers -> Blank Page Issue
I've been working on an application that is on four clustered servers using standard ASP.NET SQL Server state management. The application works fine when a user uses only one server (for the entire duration on the site), but when the user is redirected to a different server (due to a load balancer - F5) upon a post-back of a page, a blank page is displayed (HTML can be found below). Does anyone know what I can due to correct this problem? Here is the HTML I get after a page is posted back by a button event. (If it's not a post back the page always renders correct.) <!DOCTYPE HTML...

How to extract session data from MSSQL using "Sql Server" session state mode
I have confronted with some difficulties: I have a task to extract logged user session data from database to collect statistic information from SPPS 2003 (Sharepoint Portal Server) for analyzing purposes.Information I need looks ordinary enough: username, datetimes of user log in and log out, etc..After digging hundreds of articles and docs, I had found out that session object is serialized into database record. It is ok, but I found no decription about where this data can be stored or how can I have access to it.What can I do with it or what should I read for achieving my object? Thanx...

USER CAN'T CONNECT THE REPORTING SERVER (AD USERNAME) using SQL SERVER MANAGMENT STUDIO 2005
Normal 0 false false false EN-US X-NONE X-NONE ...

Session state management using web services.
 Hi all ,i am working of a hospital management system which we desided to develop using atlas frame work. we have created the application main to sections using atlas script call back architecture. we are using scripts to pack the user entered data to the web service and in that web service we are entering the data in to the database.all this happening with out a post back of the page.now comes the problem. we are not being able to handle the user session properties. we came to know that we cant access session variables in web services. we are in a trap now. how we can manage the sessio...

connection string in the SQL Server Management Studio Express
i want to change the database from access to SQL Server Management Studio Express the old connection string in the asp is <% Set strConn = Server.CreateObject("Adodb.Connection") Provider="provider=microsoft.jet.oledb.4.0;" dbpath="data source=" & Server.MapPath("../data.mdb") Pwd = ";jet oledb:database password=dolunlimit" strConn.open provider & dbpath & Pwd%> i have write the new connection in the SQL server, but it can not work <%Set conn=CreateObject ("adodb.connection")strConn="driver={SQL Server};server=192.168.0.102;uid=sa;Pwd=sa;datab...

Web resources about - Using SQL Server for Session State Management - Custom Location for Connection String - asp.net.state-management

Management - Wikipedia, the free encyclopedia
Management in business and organizations is an art that coordinates the efforts of people to accomplish goals and objectives using available ...

Management - Wikipedia, the free encyclopedia
Management in business and organizations is the function that coordinates the efforts of people to accomplish goals and objectives using available ...

Management - Wikipedia, the free encyclopedia
Management in business and organizations is the function that coordinates the efforts of people to accomplish goals and objectives using available ...

Management - Wikipedia, the free encyclopedia
Management in businesses and organizations is the function that coordinates the efforts of people to accomplish goals and objectives by using ...

Smarkets: Online betting company with ‘self management’ structure
... the reality for the team at Smarkets , an online betting company based near London’s Silicon Roundabout. The business is run with a “self-management” ...

Agile Project Management in a Larger Organisation – Video of my talk
I was recently asked to do a short talk and Q&A for an agile project management meetup in London. You can see the full video here: https://s ...

Learn Six Sigma and Lean project management for $79
Knowing (and mastering) the Six Sigma and Lean methods is a must for anyone looking for a career in project management today. And this training ...

Master project management with two massively discounted certification courses
In the professional sphere, experience with project management is one of the most valuable skills you can have. Starting is harder than just ...

10 Most Widely Used Content Management Systems Online
... software. The 21st century brought with itself a revolution in the field of website designing and development in the form of Content Management ...

Pain management: We have the technology
From time to time you might see a story pop up written by someone in chronic pain. That story will often detail the needless and unproductive ...

Resources last updated: 11/28/2015 2:00:41 PM