Re: Connection string stored in registry



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

.



Relevant Pages

  • Re: Encryption of Connection String
    ... I don't think ANY encryption is applied to the string by default. ... > Do you know what level of encryption IS applied to the connection string? ... >> to the SQL Server via SQL authentication the password is only ...
    (microsoft.public.sqlserver.security)
  • Re: VB2005 - Secure Access to SQL Server through Application Only
    ... it does not appear you can edit the connection string within the context of the application; it is considered a read-only property. ... My question is when I should be modifying the connection string and is there any way to insert something into the string to make it use an application role? ... Also have a look at the various Encryption classes. ...
    (microsoft.public.dotnet.languages.vb)
  • Use Dpapi with Shared Asp.Net Web Host?
    ... I'd like to use an encrypted database connection string. ... but the portion of the code that calls the encryption class and ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Use Dpapi with Shared Asp.Net Web Host?
    ... I'd like to use an encrypted database connection string. ... but the portion of the code that calls the encryption class and ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Byte array to string and back - newbie question
    ... // Create a symmetric algorithm. ... This is done to make encryption more ... // Encrypt a string into a string using a password ... // Decrypt a byte array into a byte array using a key and an IV ...
    (microsoft.public.dotnet.framework.aspnet.security)