0

My boss gave me a task. He wants that ASP.NET and C# developers at office should be away from live Database, and for that purpose, I have to make a dll which will be referenced by each and every ASP.NET project, and dll give the SqlConnection object to projects, but developers should not read the connection string through debugger or any other way, and all other properties of data acess should be hidden to user, developer will work on test environment, but after deployment to live they will be referenced with my dll whcih will give them connection object with hidden connection string.

How can I achieve this task?

1 Answer 1

3

Why not use a seperate connectionstrings.config file for the test-environment and the production environment. When you deploy you application, just use the correct config file.

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

2 Comments

Exactly, when I put something live, someone with the correct authorisation and access on the live server will replace my local connection string with the live credentials, that I cant see or access, surely its easier to just do this.
you can always encrypt the connection string and let .NET decrypt it automatically and pass it along. But in the end, your organization tech team needs to change. for development: only use DEV DB. For live, use live DB and when you deploy to live, the deployer will change the conn string in the config file. its that simple. don't even give anyone else the conn string details of anything other than DEV or test.

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.