CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> ASP.NET - InMotion Framework

 How to handle encryption decription of connection string ?

Print topic Send  topic

Author Message

Posts: 1
Posted: 10/16/2008, 1:13 AM

Hi Friends,

I have created two functions that encrypt and decrypt the connection string in web.config. But whenever I want to use connection string. I have to always decrypt web.config and then again encrypt it back. Does there any other way which i can use.

I'm using section.SectionInformation.ProtectSection(" <encryption configuration provider> ") and section.SectionInformation.UnprotectSection()
View profile  Send private message

Posts: 191
Posted: 10/30/2008, 11:58 AM

I add the following code to the After Initialize event of my login page so the connection string will be encrypted. .Net automatically decrypts the conection string when it is needed.

Dim configFile As System.Configuration.Configuration  
Dim configSection As ConfigurationSection  
configFile = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)  
configSection = configFile.Sections("appSettings")  
If Not configSection.SectionInformation.IsProtected() Then  
End If

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.