dyarosh
asked on
Entity Framework 4.0 with tables from 2 different Database Servers
I am new to EF and am trying to develop a small application using MVC and EF. My application needs to display a list of employees that exist in a table stored in MS SQL Server 2008. The table has the following fields:
ENL_Contacts Table
ENL_ContactID (PK, int, not null)
ENL_EMP_ProfileID (int, not null)
ENL_GroupNameID (int, not null)
The ENL_GroupNameID exists in another MS SQL Server table and is in the same model as the ENL_Contacts Table. The ENL_EMP_ProfileID is a key into an Employee Table that exists in an Oracle DB. I created a second model that brings in the Employee Table from the Oracle DB.
The EMP_Employee Table in the Oracle DB contains the following fields that are needed by my application:
EMP_Employee Table
EmployeeID (PK, int, not null)
FirstName (varchar(50), not null)
LastName (varchar(50), not null)
(the rest of the fields are not displayed)
How can I create a "View" that joins the ENL_Contacts Table from the ENL Model with the Employee Table from the EMP Model?
I want to be able to display the following:
ENL_ContactID, ENL_EMP_ProfileID, LastName, FirstName, ENL_GroupNameID
Any help or suggestions is greatly appreciated.
ENL_Contacts Table
ENL_ContactID (PK, int, not null)
ENL_EMP_ProfileID (int, not null)
ENL_GroupNameID (int, not null)
The ENL_GroupNameID exists in another MS SQL Server table and is in the same model as the ENL_Contacts Table. The ENL_EMP_ProfileID is a key into an Employee Table that exists in an Oracle DB. I created a second model that brings in the Employee Table from the Oracle DB.
The EMP_Employee Table in the Oracle DB contains the following fields that are needed by my application:
EMP_Employee Table
EmployeeID (PK, int, not null)
FirstName (varchar(50), not null)
LastName (varchar(50), not null)
(the rest of the fields are not displayed)
How can I create a "View" that joins the ENL_Contacts Table from the ENL Model with the Employee Table from the EMP Model?
I want to be able to display the following:
ENL_ContactID, ENL_EMP_ProfileID, LastName, FirstName, ENL_GroupNameID
Any help or suggestions is greatly appreciated.
You can create a "linked server", then create a view, and map the view to EF.
ASKER
Does creating a "linked server" require doing something on the SQL Server or Oracle Server? If yes I won't be able to do that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did not get a response that addressed the problem so I came up with another solution.