Search code examples
asp.netsqlsql-server-2000connection-string

connection string with no user name and password, asp.net


i have a website built in asp.net connecting to a sql 2000 db. within my web.config file, i have a connection string referencing a DSN. in order for my db connection to work i have to include the username and password within the string. for security reasons, is there any way to connect to my db without displaying the username and password. maybe a method to encrypt the information?? the trusted connection string method did not work for me.

current method

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

trusted method (did not work in my server environment)

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

Solution

  • You can encrypt connection strings in your web.config file.

    See How To: Secure Connection Strings When Using Data Source Controls on MSDN.