Share a Connection string between multiple web projects

后端 未结 2 922
礼貌的吻别
礼貌的吻别 2020-12-11 07:09

OK I have two web projects WebProject1 & WebProject2. Both require database connectivity so this is all in a C#.NET project called Common.

Now my question is cur

2条回答
  •  生来不讨喜
    2020-12-11 07:40

    There's a few ways you could do it:

    1. put common configuration settings in machine.config as shown here
    2. put common configuration settings in a central file and link to that in each projects's app.config as shown here
    3. store the configuration settings in the registry

提交回复
热议问题