What is the best way to dynamic load connection strings

前端 未结 2 1974
栀梦
栀梦 2021-01-24 23:26

I\'ve seen some other posts in this topic, but thought I would ask the qustion with a description on my problem.

I have a login page wich uses SQL provider for the user

2条回答
  •  萌比男神i
    2021-01-25 00:06

    Would it work to create a simple map between the user's organization and the appropriate database connection?

    It could be as simple as a Dictionary initialized in global.asax. The key would be the company and the name of a connection string defined in web.config.

    If you need to make this configurable, you can load the values for such a dictionary from a custom configuration section.

提交回复
热议问题