encrypt SQL connectionstring c#
c#, connection-string, encryption, sql
Solution
You should store your connection string in a config file and encrypt that section. See https://web.archive.org/web/20211020203213/https://www.4guysfromrolla.com/articles/021506-1.aspx or http://msdn.microsoft.com/en-us/library/89211k9b%28VS.80%29.aspx.
Problem
I created an c# application (not asp webpage) which connects to a sql 2005 server. In my sourcecode the password and userid for this sql-server is coded plain text in ConnectionString. ``` SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=server1;"+ "Initial Catalog=mydatabase;"+ "Integrated Security=no;"+ "User ID=admin;Password=mypassword;"; con.Open(); ``` Is there a easy way to encrypt password or whole connectionstring, that other peoples who disassemble my tool are not able to see the password? thanks