简体   繁体   中英

Entity Framework across Multiple Databases - SQL Server & DB2

Can anyone give me a bit of a steer in the right direction.

I'm currently trying to write a web interface using asp.net mvc3 which provides a singular view of two systems with backend databases in MSSQL and DB2.

Being new to the entity framework I've attempted to connect to each of the databases in isolation and can pull data back succesfully.

The next logical step is to attempt to join the databases together to gain some leverage over the data. This is where I've hit a bit of a stumbling block.

Looking at Entity Framework it doesn't appear to facilitate cross database joins when the databases are sat on different physical servers. Have I missed something obvious here? I can't seem to find any reference to this?

As a fall back option I thought about using linked servers and wrapping the sql in a view which would theoretically allow me to run the types of queries I need. Has anyone done this?

I thought about using linked servers and wrapping the sql in a view which would theoretically allow me to run the types of queries I need. Has anyone done this?

I have done this approach many times. I have only needed one or two tables from the other database, so creating the views is easy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM