1

Is it possible to hide the user id and password from source when the developer can trace the source?
Sorry for my bad English.

2

5 Answers 5

2

you should keep the connectionstrings in web.config file and then encrypt the web.config file so that the passwords are safe. you can find help on how to encrypt web.config file here http://msdn.microsoft.com/en-us/library/dtkwfdky(v=vs.100).aspx

Sign up to request clarification or add additional context in comments.

1 Comment

Just to clarify: the web.config is as safe as the server itself.
2

I'm guessing you are putting the connection string in the source code. If you are the first thing you should do is move it to the app.config / web.config file.

http://msdn.microsoft.com/en-us/library/ms254494(VS.80).aspx

If you are already using the app.config or web.config file can you give more details.

Comments

2

If using MS SQL you can use integrated auth and simply not have user name and password in the connection string:

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

(sample copied from http://www.connectionstrings.com/sql-server-2008)

Comments

1

A way to not store the password in the source is to make it a part of the server environment (read from a file, store it into an environment variable, etc.)

2 Comments

environment variable? How to?
By Googling "vb.net environment variable", I found this: msdn.microsoft.com/en-us/library/77zkk0b6.aspx
1

Encrypt the connection string, more details can be found here: Encrypting Configuration Information Using Protected Configuration and Securing Connection Strings

1 Comment

but with trace the source i can see the password.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.