是否有可能进行跨使用LINQ不同的数据库连接? [英] Is it possible to perform joins across different databases using LINQ?

查看:301
本文介绍了是否有可能进行跨使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆