多个数据库到一个网站 [英] Multiple database to a single website

查看:97
本文介绍了多个数据库到一个网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..



是否可以将我的网站与2个数据库连接?如果是的话,我将把我的客户详细信息分成2个数据库。在这种情况下,我如何处理登录页面并将客户端转发到他们的数据库以获取他们所需的详细信息。

hi..

Is it possible to connect my website with 2 databases?. if yes, i am going to separate my client details into 2 databases. in this case how can i handle log in page and forward the client to their database in order to get their required details.

推荐答案

通常,避免这种做法。您仍然可以拥有一个数据库并正确管理以仅显示特定的用户相关数据。
Normally, this kind of practices are avoided. You can still have one database and manage properly to show only particular user related data.


当然可以。您可以根据需要连接到任意数量的数据库,但正如其他人指出的那样,您可能不应该这样做。



所有你需要做的就是有另一个连接字符串并使用那个。它们可以在您的web.config中命名,然后按名称引用。
Of course you can. You can connect to as many databases as you like but as others have pointed out you probably shouldn't.

All you have to do is have another connection string and use that one. They can be named in your web.config and then referenced by name.


Google搜索 - 多个数据库asp.net [ ^ ] - 这应该给你一个开始。但请考虑评论中其他海报给出的建议。我还会在继续之前分析这种技术的缺点。搜索链接应该为您提供足够的信息。
Google search - multiple database asp.net[^] - this should give you a start. But do consider the suggestion given by the other poster in the comment. Also I would analyze the downsides of this technique before proceeding. The search link should give you enough information.


这篇关于多个数据库到一个网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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