访问多用户和多数据库 [英] Access multiusers and multidatabases

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

问题描述







我有一个要求,就是开发了一个ASP.net网络应用程序。我想为具有单独数据库的不同公司托管此应用程序,但网站只能在IIS中托管一个副本。因此,基于用户登录,应用程序应该连接不同的数据库服务器。



用户可以根据其凭据访问应用程序:user,pwd和company。问题是,如果用户从墨西哥进入,它有来自墨西哥的环境,但如果用户从巴西进入,则两个环境都来自巴西,反之亦然。



如何如果有很多用户同时工作,我可以这么做吗

每个人都必须访问数据库和环境只来自其国家



谢谢!

Hi,


I have a requirement like, developed an ASP.net web application. I want to host this application for different companies with seperate database, but website shall be hosted only one copy in IIS. so, based on user login, the application should connect different database server.

A user can access to the application according to its credentials: user, pwd and company. The issue is that if the user enters since Mexico, it has the enviroment from Mexico but if a users enters from Brazil, both enviroments are from Brazil and viceversa.

How can i do if there are many users working simultaneously but
each one must access to the database and enviroment only from its country

Thank you!

推荐答案

您可以在您的ASP.NET Web应用程序中使用全球化,或者一个简单的方法是使用登录用户的UserID并显示他他必须看到的数据。



连接到不同的数据库不是一个好主意(直到您的应用程序具有企业级别的复杂性)。您可以为来自不同区域设置的用户创建不同的表,并根据用户所属的区域设置向每个用户显示数据。



多个用户由您的Web服务器处理(希望是IIS),因此您不必担心该功能,所有您需要注意的事项是向用户表示数据的方式。
You can use the globalization in ASP.NET web application of yours, or a simple method would be to use the UserID of the logged in user and show him the data that he has to see.

Connecting to different database won't be a good idea (until your application is of enterprise level of sophistication). You can create different tables for the users from different locale and show the data to each user depending on the locale the user belongs to.

Multiple users are handled by your web server (hopefully, which will be IIS) and thus you do not have to worry about that feature, all you need to take care of is the way of representing the data to the user.


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

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