473,770 Members | 4,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different connection strings based on user

8 New Member
I have a fairly large webapp which is used by many customers. Each customer has its own database.

I want to use the same webapp for all of the customers, but they still need to have separate databases and thus different connection strings.

What is the best way to do this?

I thought of this approach:
1. One database contains a table called Customers. This table contains all customers and what their connection string is.
2. When a customer is accessing the webapp, they should also provide their customerId (http://server/webapp/Default.aspx?cu stomerid=xx)
3. Then i will retrive the connection String attributes from the Main database and will store in the session and its working finr.


But i think this is not a good solution. So can anyone suggest solution.

Thanks in advance.
Mar 16 '08 #1
2 1122
balabaster
797 Recognized Expert Contributor
I have a fairly large webapp which is used by many customers. Each customer has its own database.

I want to use the same webapp for all of the customers, but they still need to have separate databases and thus different connection strings.

What is the best way to do this?

I thought of this approach:
1. One database contains a table called Customers. This table contains all customers and what their connection string is.
2. When a customer is accessing the webapp, they should also provide their customerId (http://server/webapp/Default.aspx?cu stomerid=xx)
3. Then i will retrive the connection String attributes from the Main database and will store in the session and its working finr.


But i think this is not a good solution. So can anyone suggest solution.

Thanks in advance.
I'm assuming that the database server is the same... i.e. they're all hooking up to the same instance of SQL Server (or some other server)? Or Microsoft Access? If that's the case, your customers table (which would be in a separate database) would only need to hold the name of the database or the filename of the access database. It does seem kind of hokey... but it's probably also the most secure.

In a commercial environment I would probably set a group username and password too in that table which they can save in a cookie so they don't have to enter it every time they connect - only the first time. This way is most likely the most secure because any given customer can't even get access to the connection string for another customer's database let alone any access to their data.
Mar 16 '08 #2
Brad Orders
21 New Member
Also, take care if you are using the URL:
http://server/webapp/Default.aspx?cu stomerid=xx

You will need to make sure that one customer cannot impersonate another customer by simply changing the customerid in the URL. This will need to happen on every page in the web app - not just the page after login.

I agree that the customer should provide a password as well as their id. If security of the database is also an issue, then consider encrypting the values in the table.

Good luck.
Mar 18 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2048
by: Minh Tran | last post by:
In order to minimize the number of connection strings I have to use to access different databases on the same Sql Server, I was considering storing all stored procedures in just one database. I want to do this because connection pooling in my application - ASP.NET is based on this connection string. So if I need to access 6 different databases on one sql server & set 6 different connection strings, I end up creating 6 different...
4
4437
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big strings' instead of 'one liners' I check the streams for terminators. I'm having problems with the connection, I've been looking and debugging for 2 weeks now (debugging with an emulator is terribly slow..) but I'm not getting it...
3
15180
by: Tim Marshall | last post by:
I'm starting to work with connection strings and Oracle. The connection string syntax is pretty much the same as MS SQL (based on one of Lyle's posts in response to a question I had about a jmonth or more ago), but now I'm wondering how to get a procedure using a connection string to prompt the user for a password. For example, the standard connect string might be: Driver={Microsoft ODBC for Oracle};Server=Timmy;Uid=tmar;Pwd=rtma In...
4
1687
by: Dan Walls | last post by:
Hi, I am deploying an ASP.Net web app into the following scenario: Internet --> Firewall --> WebServer (IIS) --> --> However I am not sure what sort of authentication options are available to me in gettingthe application to talk to the SQL server. How do I talk between the web app and the database server - if TCP/IP then
5
2131
by: Matt | last post by:
Hello, What is the best way to handle the database connection string for a class library project that will be compiled and used as a .dll? This .dll will be accessed via classic ASP and in the future by ASP.NET pages. I have created a constant that contains the connection string (as shown below).
37
8969
by: sam44 | last post by:
Hi, At startup the user log on and chooses the name of a client from a dropdownlist, which then changes dynamically the connection string (the name of the client indicates which database to use). I then change dynamically the connection string by doing : My.Settings.Item("ConnectionString") = "some connection sring" The problem is that if another user loggs in and chooses another client, then obviously it changes the connection string...
1
1381
by: CodeMonkey | last post by:
We have quite a few datasets that have been designed through the IDE. In our application, we generate a connection string to the server based on what the user configures the application for. The problem is, our connection strings on the development machines are being saved into the XSD files. While this isn't a huge issue, it's storing the password in it as well. I have tried to make sure every dev's machine has the "Save Password" option...
11
2288
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Is there a way in ASP.NET 2.0 to have different connection strings settings in a web.config files that are dynamically used based upon the server that the web application is running on? For example, you have have two test web servers (TEST1 and TEST2) and a production web server (PROD1). Each of these connection to a different database for general data access and for membership/role providers. <connectionStrings> <add name="Test1DB"...
2
1768
by: Simon | last post by:
I have problems with connection strings. I have added new connection string to Web.config: <connectionStrings> <add name="ConnStr" connectionString="xxxxxxxxxxxxxxx"/> </connectionStrings> Bu when I want to access the data with: coll = ConfigurationManager.ConnectionStrings;
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.