1: have a look at the SqlConnectionStringBuilder class, as this will give you the ability to change the password within a connection string: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx[^] Using this class, you can store the full connection string, with a dummy password in the app.confg file. Then, when you want to use it in code, you can use the SqlConnectStringBuilder class to alter the string so that it includes the correct password. 2: Have a look at this article, as I believe it does exactly what you want: Encrypt and Decrypt ConnectionString in app.config and/or web.config![^]