Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 4th, 2007, 04:15 AM
Registered User
Join Date: Sep 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Modifying in-memory connection string


I need to deploy data driven web sites for dozens of clients. Each client will have their own URL and their own SQL Server database, but the actual code (.aspx files, .aspx.cs files, .gif files, etc.) of each site is exactly the same. Obviously, I don't want to duplicate the code for each site.

I'm thinking of using this solution:
* Have just one directory with all the files, including the web.config, and point all URLs to that one directory.
* Have a separate database for each site, with the same name as its URL - so the site "bigclient.com" would have database "bigclient.com", etc.
* Do something clever in the Global.asax, so when a site starts up it changes its cached connection string - to make it use the database matching the url of the site.

I know how to change the connection string in the web.config file. However, because there would be only one web.config, if one site updated the web.config file with its connection string, this would affect all other sites. So I want to update the in-memory connection string only, not the actual web.config file.

I could change the code so all sites use the one database, and add a "url" field to all tables. However, this would be a lot of work. I'd much prefer to have each site change its own in-memory connection string on startup if possible.

How do I do this?
Is there a better way of solving the "1 set of source files, multiple databases" problem?

Thanks in advance for your help,

Matt Perdeck


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection string bex BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 August 3rd, 2008 02:16 PM
Connection String jmss66 Oracle 4 August 8th, 2006 03:19 AM
Connection String fs22 Classic ASP Databases 3 August 30th, 2004 01:25 AM
Connection String phungleon Dreamweaver (all versions) 1 February 11th, 2004 05:14 AM
connection string aadz5 ASP.NET 1.0 and 1.1 Basics 4 October 20th, 2003 08:43 AM

All times are GMT -4. The time now is 04:30 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.