Re: Connection string stored in registry
- From: nbs.tag@xxxxxxxxx
- Date: 8 Jun 2006 10:36:25 -0700
The thing is, i dont wanna now whats best, like encryption, or a global
file, i just wanna know is this possible, what i am describing is it
possible, ive already seen the the part where they describe getting
back the username, pw, etc, and ive alrady looked into the enterprise
tool and as far as i can tell it will not allow me to do what i want to
do
Mythran wrote:
<nbs.tag@xxxxxxxxx> wrote in message
news:1149772794.131405.175120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hey guys heres my question. I was told by a little birdie that .net 2.0
has the ability to read a connection string directly from a registry
key. so in the registry key a string value of say :
database=northwind;user=username;password=pw; is stored at
software/myApp/connSTR in the registry, i was told its possible to just
place
<connectionStrings>
<add name="asd"
connectionString="value=registry:HKLM\SOFTWARE\myApp/connSTR;"
</connectionStrings>
or somehting of the sorts in the web.config file and it could read the
string back. Is this possible and if so, what would be the correct
format for soing so?
Check out Microsoft Patterns and Practices, Data Access Application Block.
By using the Configuration Application Block along with the DAAB, you can
store the connection strings and encrypt them at the same time, without
manually handling the encryption stuff :)
Anywho, to just use plain jane web.config file to store the connection
string, just place the following in your web.config file:
<appSettings>
<add key="DevConnStr" value="connection string here" />
</appSettings>
This is one way to do it...I have also heard about the connectionString(s)
element .. read something about it yesterday...somewhere..
HTH,
Mythran
.
- References:
- Connection string stored in registry
- From: nbs . tag
- Re: Connection string stored in registry
- From: Mythran
- Connection string stored in registry
- Prev by Date: Re: Cast form from VB 6 to C# at runtime
- Next by Date: Learning C#
- Previous by thread: Re: Connection string stored in registry
- Next by thread: Re: Connection string stored in registry
- Index(es):
Relevant Pages
|