Reputation: 436
ASP.NET websites should store connection string in web.config file for various reasons and best practice. Today I was asked by my manager that "Can we store DB username and password in another location on top of web.config file? It will be easier to change SQL id/password without having developer change it every time on Production if that is done".
I wanted to ask experts the same question - is it possible to retrieve SQL connection string id/password from another place instead of web.config? I know the best practice is to store it into web.config but I am just curious is it even possible at all?
Upvotes: 0
Views: 338
Reputation: 72230
Of course, you can read the username/password from virtually anything that is accessible through code (if I understand your question correctly).
Have you looked at Web Config Transformations?
Upvotes: 2