Scenario: You want to store sensitive database connection details separately from your code. What is the recommended approach in ADO.NET for achieving this?

  • Connection Strings in App.config
  • Hardcoding Connection Strings
  • Store in Environment Variables
  • Use Credential Management API
Option 1, "Connection Strings in App.config," is the preferred method for storing sensitive database connection details separately from the code. By placing connection strings in the application configuration file (App.config), you can easily manage and update them without modifying the source code. This approach enhances security by keeping sensitive information, such as usernames, passwords, and server addresses, out of the codebase, reducing the risk of exposure. Additionally, it allows for flexibility in deploying applications across different environments, as configurations can be tailored accordingly.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *