Reputation: 1751
I'm building an application for our client base, all of whom have pre-existing database's. The business owners will be able to read and report on their local business DB's through this app, all data will be specific to their business.
I'm planning on doing the following:
My question is, is it best to put every data connection in as a new entry in web.config and just reference the connstrings throughout the app off a session variable ie:
Or is there a better approach? Thanks for the input.
EDIT: I'll note that each db will have a GUID and I'll be constantly validating the connection against account credentials so I'm not too concerned about the security of this approach, just it's implementation as a viable option.
Upvotes: 1
Views: 120
Reputation: 25258
How often will you be adding/removing databases? If rarely, web.config should be ok. If often, I would only store the conn string to the master database in the web.config, and store the details of each client database in a table there.
Though after reading your question again, "hundreds", to me, means storing them in a table rather than Web.config, even if they are never updated. I simply wouldn't want that many hard coded strings in a config file.
Upvotes: 1