LINQ to SQL for tables across databases. Or View?

Posted by BritishDeveloper on Stack Overflow See other posts from Stack Overflow or by BritishDeveloper
Published on 2010-04-22T09:39:36Z Indexed on 2010/04/22 9:43 UTC
Read the original article Hit count: 208

Filed under:
|
|
|
|

I have a Message table and a User table. Both are in separate databases. There is a userID in the Message table that is used to join to the User table to find things like userName.

How can I create this in LINQ to SQL? I can't seem to do a cross database join.

Should I create a View in the database and use that instead? Will that work? What will happen to CRUD against it? E.g. if I delete a message - surely it won't delete the user? I'd imagine it would throw an error.

What to do? I can't move the tables into the same database!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about linq-to-sql