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

  • Home
  • SEARCH
  • 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 7512799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:59:02+00:00 2026-05-29T23:59:02+00:00

I am trying to create a sandbox environment using two matching databases held on

  • 0

I am trying to create a sandbox environment using two matching databases held on different servers. What I am trying to is pass data in between but only when an Administrator gives the ‘Ok’. Now the coding behind this is fine, I have a solution for how I am going to implement this but what I am struggling to do is have two dataclasses both referencing the different databases but with matching tables?

When I attempt to pull any form of data through LINQ I get the error that the member is already defined more than once.

Is there any way of having matching dataclasses (but point to different servers), without having to change the table names?

  • 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-05-29T23:59:03+00:00Added an answer on May 29, 2026 at 11:59 pm

    If the mapping between your classes and the database schema is exactly the same across the two databases, you could have just one set of classes and simply initialize two data contexts with different connection strings to access the databases.

    Here’s an example using LINQ to SQL:

    var leftConnString = "Data Source=LeftServer;Initial Catalog=MyDatabase";
    var rightConnString = "Data Source=RightServer;Initial Catalog=MyDatabase";
    
    using (var leftContext = new DataContext(leftConnString))
    {
        using (var rightContext = new DataContext(rightConnString))
        {
            // Retrieve entities from 'leftContext'
            // and persist them in 'rightContext'
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I am trying create alert dailog using glade,but its not working .am i doing
I am trying to create a paypal sandbox test account using preconfigured account method
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create a user account in a test. But getting a Object reference
Trying to create a list to return some JSON data to a view. Following
I'm trying to figure out how to create a sandbox area in my new
I'm trying to make Paypal's sandbox API work and I'm using a sample project
I am trying create a data.frame from which to create a graph. I have

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.