Using LINQ to SQL with multiple databases
- by Stuart Ferguson
I am working on a new project and hoping to use LINQ to SQL for the data
access but have come across the following issue.
I need to have my application access 3 databases with similar but not
the same table structure, for example
Database1 and Database 2 has a table called tblCustomer with 2 columns
CustomerKey and CustomerName
Database2 has a table called tblCustomer with 3 columns CustomerKey,
CustomerName and CustomerPostCode
I am looking for a solution that will allow me a query all three
databases without the need for 3 GetCustomerList functions as Database1
and Database2 could use the same function as are the same structure,
with an override function for database 3 to bring back the additional
field.
Is there a way i can declare a base datacontext class to handle Database
1 and 2 with an inherited version for Database 3.
Thanks In Advance
Stuart Ferguson