tags:

views:

195

answers:

3

in have database

1. test 2. test2

database test

table1 field [ id ,password ,name , lastname ]

database test2

table2 field [ id]

how to select test and test2 where table1 have id in test2.table2.id

in c# with sql server 2005

+2  A: 

Have you tried it? You just write the database name test2.dbo.tblFoo, though you may need to declare an alias (just write a word after writing the actual name). And the account will obviously need permissions to both DBs.

Noon Silk
silky, please tell me this isn't you: http://www.hotchickswithdouchebags.com/uploaded_images/Hipsterbags-789913.jpg
MusiGenesis
MusicGenesis: I pretty much fell over laughing. No, that isn't me.
Noon Silk
@silky: when I saw that picture myself, I thought "where do I know this guy from?" and then I saw your picture just now. The pic has Corona Light (an alleged "beer") in the background, and I assume any Australian bar that served it would be burned to the ground, so I figured it wasn't you. But I wanted to be sure.
MusiGenesis
Yeah, I agree, Corona Light wouldn't fly here, I've never even seen it, and that guy doesn't exactly have the tan of someone who sits at a computer virtually 24/7 :P
Noon Silk
@silky: probably not a real tan. Young American men are known to spray-paint themselves orange as a way of attracting females. I really wish I was kidding about this: http://www.hotchickswithdouchebags.com/2007/10/oompa-prompa-oompity-prom.html
MusiGenesis
A: 
SELECT /* stuff */
FROM table1 t1
JOIN table2 t2 ON t1.id = t2.id
cletus
A: 

I can use some functionality in ORM, Hibernate Shards for example.

merin