Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7866337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:21:56+00:00 2026-06-03T00:21:56+00:00

I have website1 and webiste2 that runs against MyDatabase. In MyDatabase I have some

  • 0

I have website1 and webiste2 that runs against MyDatabase.

In MyDatabase I have some tables: dbo.Users, dbo1.Posts, dbo2.Posts. There is a foreign key relation ship between dbo.Users and dbo1.Posts, and dbo.Users and dbo2.Posts.

I want website1 and website2 to run the same code base, is it possible to have website one get it’s Posts from dbo1.Posts, while website2 gets their posts from dbo2.Posts?

The thought is that the desired schema (dbo1 or dbo2) would come from a configuration file.

In my situation, the information in dbo1.Posts and dbo2.Posts could be considered confidential. There may be users that might have access to both, or there might be users that have access to one. So as I see it there are two approaches, separate the databases physically, or logically. My Task at hand is to investigate if it can be done logically or not

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:21:58+00:00Added an answer on June 3, 2026 at 12:21 am

    Okay so here is what ended up happening. Still not sure if it’s the best solution, but if anybody comes looking for the answer to this question I did figure out a way to make it work.

    With that said I still agree with Matt, and Hacked that there should be a simpler way to do this.

    There are three diffrent pices to my puzzel.

    First there was a map for the entity to table in question where I used the following:

    this.ToTable("Posts", ConfigurationHelper.GetSiteSchema());
    

    Second I had a line in a Configuration helper that read from the AppSettings in the Web.config file

        public static string GetSiteSchema()
        {
            return ConfigurationManager.AppSettings["SiteSchema"];
        }
    

    Third in the web.config file I had added an Appsettings as follows:

     <appSettings>
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
        <add key="SiteSchema" value="dbo1"/>
      </appSettings> 
    

    After building the app and running it I get the posts from dbo1.Posts. I can then switch the string in the web.config file to “dbo2”, refresh the page and see the posts from dbo2.Posts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read in the documentation that there are 4 or 5 ways in
I have on TFS that projects in folders: \root \website1 \website2 \libraries class project1
I have website where users can login with their Facebook account. I am using
So basically I have website that has names of cities that can be checked
I'm using jQuery. I have website feature that does an ajax search and returns
I have a single webpage that is shared on 9 different domains. I want
I have seen that , this happend twice that , in my root index.php
I have the following code in website1.com: <script type=text/javascript> document.cookie = qwe=1; alert(document.cookie); </script>
I have a website in IIS 6, let's call it WebSite1. I have a
I have a project developed in .net, and the URL for that is http://localhost:2688/WebSite2/Default.aspx

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.