views:

188

answers:

2

I want to add the new tables to dbml file dynamically from another database

Thank you

A: 

You won't be able to do this. A DataContext is intended to encapsulate a single database - or part of a single database.

If this is a SQL Server database, and the second database is on the same server, I'd suggest creating a view in the first database that selects data from a table in the second one.

Aaronaught
A: 

Hello,

Yes only one database is supported with LINQ to SQL. You can use a separate data context file though for this database. But you can't use both contexts in the same query, so you can't join across both databases. You can, however, use queries in stored procedures and join across both databases there, provided they are on the same server or a link server is setup in SQL Server.

HTH.

Brian