Connection String in Registry

Discussion in 'ASP .Net' started by Jason MacKenzie, Apr 15, 2004.

  1. 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
     
    Jason MacKenzie, Apr 15, 2004
    #1
    1. Advertising

  2. 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.

    "Jason MacKenzie" <> wrote in message
    news:...
    > 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
    >
    >
     
    Kevin Spencer, Apr 15, 2004
    #2
    1. Advertising

  3. Jason MacKenzie

    Patrice Guest

    I saw once :

    http://msdn.microsoft.com/library/d.../en-us/cpgenref/html/gngrfidentitysection.asp

    That said I don't know if the "registry:" syntax is only supported in this
    particular case or is a general option. Let us know if you test please...

    Patrice


    "Jason MacKenzie" <> a écrit dans le message de
    news:...
    > 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
    >
    >
     
    Patrice, Apr 15, 2004
    #3
  4. 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>



    "Patrice" <> wrote in message
    news:...
    > I saw once :
    >
    >

    http://msdn.microsoft.com/library/d.../en-us/cpgenref/html/gngrfidentitysection.asp
    >
    > That said I don't know if the "registry:" syntax is only supported in this
    > particular case or is a general option. Let us know if you test please...
    >
    > Patrice
    >
    >
    > "Jason MacKenzie" <> a écrit dans le message

    de
    > news:...
    > > 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
    > >
    > >

    >
    >
     
    Jason MacKenzie, Apr 15, 2004
    #4
  5. Jason MacKenzie

    Curt_C [MVP] Guest

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

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "Jason MacKenzie" <> wrote in message
    news:OLa$...
    > 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>
    >
    >
    >
    > "Patrice" <> wrote in message
    > news:...
    > > I saw once :
    > >
    > >

    >

    http://msdn.microsoft.com/library/d.../en-us/cpgenref/html/gngrfidentitysection.asp
    > >
    > > That said I don't know if the "registry:" syntax is only supported in

    this
    > > particular case or is a general option. Let us know if you test

    please...
    > >
    > > Patrice
    > >
    > >
    > > "Jason MacKenzie" <> a écrit dans le message

    > de
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Curt_C [MVP], Apr 15, 2004
    #5
  6. Jason MacKenzie

    Patrice Guest

    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


    "Jason MacKenzie" <> a écrit dans le message de
    news:OLa$...
    > 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>
    >
    >
    >
    > "Patrice" <> wrote in message
    > news:...
    > > I saw once :
    > >
    > >

    >

    http://msdn.microsoft.com/library/d.../en-us/cpgenref/html/gngrfidentitysection.asp
    > >
    > > That said I don't know if the "registry:" syntax is only supported in

    this
    > > particular case or is a general option. Let us know if you test

    please...
    > >
    > > Patrice
    > >
    > >
    > > "Jason MacKenzie" <> a écrit dans le message

    > de
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Patrice, Apr 16, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HK
    Replies:
    1
    Views:
    3,649
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  2. Replies:
    0
    Views:
    757
  3. Leny
    Replies:
    3
    Views:
    16,934
    Daniel
    Feb 1, 2005
  4. Jason
    Replies:
    3
    Views:
    406
    Mark Rae
    May 17, 2007
  5. Collin Miller
    Replies:
    10
    Views:
    606
    Roger Pack
    Jul 9, 2010
Loading...

Share This Page