Multiple context in query
Options
I was able to hold down Ctrl key and drag two different DB from the same server into the query, and the Connection indicates DB1 + DB2. Now the context of the query seems to be that of the second DB connection added. I have been unable to find out how to use a context for the first DB added. I am looking for a link to some instruction or example.
Comments
-
Thanks
-
I'm facing exactly this same issue despite having following the guide described at http://www.linqpad.net/faq.aspx#cross-database
http://stackoverflow.com/questions/1495357/linqpad-using-multiple-datacontexts -
Does anyone know of a time frame when this issue will be resolved?
-
I'm not aware of an outstanding problem: have you tried both approaches listed on the FAQ above?
-
I am also having trouble with cross database data context's. I have tried to use the "Include additional databases Details..." Option in the LINQ to SQL Connection and it will not let me use 2 different log ins for the 2 different databases, it tries to log in as anonymous. "Error: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' ", is there a config some where that I can manually edit the db connection strings?
EDIT: Well shoot, this probly isn't going to work for me since it seems that this requires sql users instead of windows users and I do not control the 2nd db server. sp_addlinkedserver fail.
Enhancement Request:
Basically like this - http://linqpad.uservoice.com/forums/18302-linqpad-feature-suggestions/suggestions/305161-cross-database-linq-support?ref=title
Please add Cross-Server Database Queries.
It would be nice to allow this this:var Server1Items = (from rec in Server1.DBInstance.TABLE1 select rec); var Server2Items = (from rec in Server2.LocalInstance.TABLEx2 select rec); Server1Items.Dump(); Server2Items.Dump();
-
@JoeAlbahari have you added cross-server database context's yet?
-
No - unless the SQL databases are linked, this is not supported.
-
@JoeAlbahari ok, so it isn't supported. Can it be something that is enhanced? like having a setting on the db connection that says sub instance name and then drag the tables over from the other server? I have been able to do this if i create a DLL of my own and create a new context for it, but that is convoluted.
User story:
As a user, I want to be able to bring in the database context from another server so that i can get data from one server with .ToArray() and join it to the data from another server's db so i can cross reference them. -
Yes, that makes sense. It's hard to implement, though, because it's conducive to namespace and assembly conflicts. I'll give it more thought after the current milestone.