Connection String in Registry

J

Jason MacKenzie

I store my connection string in the registry. Is it possible to access this
value from the web.config file? If so any help is appreciated.

Thanks,

Jason
 
K

Kevin Spencer

As the web.config file is simply text, no. You could load it from your
Application_OnStart Event Handler, though.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
J

Jason MacKenzie

That's actually where I got the idea but it doesn't seem to be working at
all:

I would like to do something like this:

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

Curt_C [MVP]

most likely the user that your app runs as doesn't have permission for the
registry either
 
P

Patrice

According to http://support.microsoft.com/default.aspx?scid=kb;en-us;329290,
it looks like that this is restricted to particular sections :

When you apply the hotfix that is described in Microsoft Knowledge Base
article 329250 (see "References"), you can use encrypted data that is stored
in the registry instead of plain text in the following configuration
sections:
a.. <identity userName= password= />
b.. <processModel userName= password= />
c.. <sessionState stateConnectionString= sqlConnectionString= />
IMO, the best location is still the web.config file (this way you have all
settings in this unique file) possibly encrypted first...

Patrice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top