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?
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: