• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Change web.config to NOT show password when connecting to a SQL Server Database

I have a web application which connects to a SQL Server database and I use this line in the web.config

    <<add key="ConnectionString" value="Server=sppgpo05;UID=intranet;PWD=password;database=myDB;"/>

Now on my database under 'Security \ Logins' I have 'intranet'

This all works fine but I wish to not have the users password in the web.config.

I've setup a domain user 'mydomain\intranet'

so the question is how do I change the line in my web.config?


1 Solution
You can read all about it here: http://msdn.microsoft.com/en-us/library/ms998292.aspx

And see more examples here: http://www.connectionstrings.com/sql-server-2008

But basically it is like this:

  <add name="MyDbConn1" 
  <add name="MyDbConn2" 
      connectionString="Initial Catalog=MyDb;Data Source=MyServer;Integrated Security=SSPI;"/>

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now