如何在不注销应用程序的情况下更改Web.config中的连接字符串. [英] How to Change Connection String in Web.config without log off of Application.

查看:107
本文介绍了如何在不注销应用程序的情况下更改Web.config中的连接字符串.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在不注销应用程序的情况下将ConnectionString更改为新数据库.连接的用户和新用户应该能够使用新数据库.
我该如何实现呢?

I need to Change the ConnectionString to new Database without Log off of Application. Connected User and new users Should be able to work on new Database.
How can I achieve this?

推荐答案

您可以尝试在Web配置中添加几个名称不同的连接字符串,可以通过代码上的配置来调用它们然后指定要使用的连接字符串的名称.
You can try adding several connection strings in the web config, with different names on it, you can call them via configuration on your code then specify the name of the connection string you are going to use.


这篇关于如何在不注销应用程序的情况下更改Web.config中的连接字符串.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆