nisar ahmad

nisar ahmad

  • NA
  • 12
  • 0

Web.Config password setting

Mar 17 2011 6:33 AM
Dear All,

I have asp.net web project which is linked with MS-SQL 2005 database engine.

In my WEB.CONFIG file i have hardcoded username and password of DSN which i am using to connect with database.

e.g: <add name="SCBDSNCONN"  connectionString="DSN=TEST_ADMIN;uid=sa;pwd=test"
         providerName="System.Data.Odbc" />


Problem:

I want to store encrypted password in web.config file.

I have work on it and i have class which encypt the password, what i want is
 
to pass the encrypted password to the xml web.config file.

Solution

e.g in web.config

<variable pass> // and that pass store the encypted value which i want to assign from some class ???
<add name="SCBDSNCONN"  connectionString="DSN=TEST_ADMIN;uid=sa;pwd=pass"
         providerName="System.Data.Odbc" />




Best Regards
Nisar

Answers (1)