how to bind dropdown list with relationship

Posts   
 
    
Posts: 97
Joined: 29-Apr-2009
# Posted on: 12-Aug-2009 12:35:01   

hello,

i am using LLBLGen 2.6 & self servicing & MS SQL Server 2005

i have two table : one is : USER & Second is : MEMBER

in User table, there are following fields,

UserID IsActive RoleTypeID

In Member table, there are following fields,

UserID CoachID

i want the following SQL query in LLBLGen

SELECT [user].IsActive, [user].RoleTypeID, member.CoachID FROM [user] INNER JOIN member ON [user].UserID = member.UserID WHERE (member.CoachID = '2')

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 12-Aug-2009 13:53:00   

Did you define an inheritance relation between UserEntity and MemeberEntity in the Designer? (They are qualified for it).

If so all you should do is fetch an entityCollection of the members specifing the required filter. (Joining to the superType will be done automaticaly).