Ok, I think I have been barking up the wrong tree here.
I think my question should have been:-

Can you point an <appSettings> key to the registry in the same way as you
can for the <sessionState sqlconnectionstring />
I have tried it but it just seems to return the string entered in the
web.config.

Sorry for the confusion.
Mike.


"Mike Dando" <mike.dandonospam.glass.co.uk> wrote in message
news:efTKT7gbDHA.3896TK2MSFTNGP11.phx.gbl...
> I may be missing something here.
> I have followed various examples which result in the following web.config
> entry: -
>
> <sessionState mode="InProc"
> sqlconnectionString="registry:HKLMSoftware\etc.... " cookieless="false"
> timeout="20" />
>
> I assumed that my code could then read/use the sessionState values in
order
> to setup a dbconnection object.
> What is the significance of assigning sqlconnectionstring as above, if you
> have to read the registry direct?
> It is reading the sessionstate values that I am trying to achieve.
>
> Thanks,
> Mike.
>
>
> "Stefan" <shogunsteffsworld.ch> wrote in message
> news:ePMDfvgbDHA.652tk2msftngp13.phx.gbl...
> > use registry object
> >
> > RegistryKey rk = Registry.LocalMachine.OpenSubKey(keypath, false);
> >
> > rk.GetValue(key to get);
> >
> >
> >
> > "Mike Dando" <mike.dandonospam.glass.co.uk> wrote in message
> > news:%23Uwd09XbDHA.3620TK2MSFTNGP11.phx.gbl...
> > > I am using the aspnet_setreg utility to encrypt a SQL connection
string
> to
> > > the registry.
> > > How do I retrieve the value at runtime to configure my dbconnection
> > > component?
> > >
> > > I have tried using the [Design Time]
DynamicProperties.ConnectionString
> > > which allows a mapping
> > > to a config file key value. However I can't seem to be able to get
this
> to
> > > work.
> > >
> > > Thanks,
> > > Mike.
> > >
> > >
> >
> >
>
>