切换Web应用程序的数据库 [英] Switching databases for a web app
本文介绍了切换Web应用程序的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想动态切换我的Web应用程序的数据库,或者说我想在相同的应用程序中使用两个不同的数据库,这些数据库有一些共同的表名。所以我想像[dbname.dbo。]那样从前端传递数据库名称。并将其存储为整个应用程序用途。我应该存储它吗?缓存,会话,应用程序,global.asax等请给我一些建议。
提前致谢....
解决方案
访问这里..
http://stackoverflow.com/questions/11950969/issues-on-dynamically-change-and-switching-the-connectionstring-in-web-config [ ^ ]
Web.config是常用的解决方案,即使数据库在文件中更改,它仍然可以工作而无需重新构建它。
I want to switch databases for my web application dynamically or say i want to use two different databases in same application having some table names in common.So i want to pass database name from front end once like [dbname.dbo.] and store it for the whole application usage.where should i store it? Cache,session,Application,global.asax etc.please suggest me something.
Thanks in advance....
解决方案
visit here..
http://stackoverflow.com/questions/11950969/issues-on-dynamically-change-and-switching-the-connectionstring-in-web-config[^]
Web.config is the usual solution, even the db is changed in file, it still work without re-build it again.
这篇关于切换Web应用程序的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文