views:

61

answers:

1

I have two tables:

Clients, and a join table that has user id, a foreign key to clients, and some other stuff.

I want to do this SQL

select TblClient.* from TblClient inner join tblUserClientProjJoin as b on TblClient.Client_ID = b.Client_FK where b.User_fk = 2

So getting a list of 'clients' that a specific user has access to.

I want to apply this result to collection I can bind to controls.

Anyone?

+1  A: 
var q = From c in db.TblClient join 
        ucp in db.tblUserClientProjJoin on 
        c.Client_ID equals ucp.Client_FK
        select c;

I haven't tested this so you may need to modify it a little. Hope this helps!

Tacoman667