是否可以使用 LINQ 跨不同数据库执行连接? [英] Is it possible to perform joins across different databases using LINQ?
本文介绍了是否可以使用 LINQ 跨不同数据库执行连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用 LINQ 跨不同数据库执行连接?如果是,那么如何?
Is it possible to perform joins across different databases using LINQ? If yes then how?
推荐答案
如果数据库在同一台服务器上,您可以创建视图(和 3 部分命名),以便可以从一个数据库查询所有表.
If the databases are on the same server, you can create views (and 3 part naming) so that all the tables are queryable from one database.
如果数据库位于不同的服务器上,您可以使用链接服务器和视图(以及 4 部分命名),以便可以从一个数据库查询所有表.
If the databases are on different servers, you can use linked servers and views (and 4 part naming) so that all the tables are queryable from one database.
这篇关于是否可以使用 LINQ 跨不同数据库执行连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文