Is there a way where I can add a connection string to the ConnectionStringCollection returned by the ConfigurationManager at runtime in an Asp.Net application?
I hav
The configuration infrastructure supports very robust encryption through the Windows DataProtection API wich uses a machine specific key to encrypt the configuration sections. This way it would not be possible to read the encrypted data anywhere but on the machine where it was encrypted.
This is the same API that is used for the Government compliant drive/folder encryption in Windows. Would this stand up to your companies security requirements?
Either manually or through your deployment automation you can execute this command to encrypt the connectionStrings section of your web.config for a specific web application.
aspnet_regiis -pe "connectionStrings" -app "/MyCoolWebApplication" -prov "DataProtectionConfigurationProvider"