Using Linq to query a linked server in Visual Studio

I am trying to use Linq to run queries on a linked server on our SQL Server machine through Visual Studio.

On SQL Server, I have successfully created a linked server and can execute queries on it. In Visual Studio, I successfully added a new data connection (in Server Explorer) to SQL Server, but linked server tables are not available.

How can I get tables of linked servers to display? Or can I do this?

+3
source share
1 answer

Usually I create a view in a local database for each table that I access through a linked server. This allows me to change links as needed without changing SQL. And you should be able to use the view in LINQ to SQL without any problems.

+5
source

Source: https://habr.com/ru/post/1715708/


All Articles