3

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

On the SQL Server, I've successfully created the linked server and can run queries on it. In Visual Studio I've added a new data connection (under Server Explorer) to the SQL Server with success but the linked server tables are not available.

How can I get the linked server tables to show up? Or can I even do this?

1 Answer 1

5

I usually create a view in a local database for each table I access through a linked server. That allows me to change the links as needed without having to change any SQL. And you should be able to use the view in LINQ to SQL without issue.

Sign up to request clarification or add additional context in comments.

1 Comment

I accepted this because it's a neat idea I didn't think of. Turns out you cannot link to a linked table in SQL Server. You can reference the table in a SQL Query but it doesn't show up as a table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.