left join problem

Posts   
 
    
nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 23-Aug-2011 09:04:34   

the sql like this:


select a.f1,a.f2, b.f3,b.f4 
from a 
left join b on a.id = b.aid 

the relation is easy to add by using RelationCollection class.

but how to get fields from two tables ?

Thank you


LLBLGen. 2.6

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 23-Aug-2011 09:53:17   

Use a Dynamic List.

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 23-Aug-2011 09:54:31   

Hello

i see. but if there are many fields , if we are using Dynamic list, it will be a big work simple_smile

anyway, thank you

memedow
User
Posts: 5
Joined: 25-Aug-2011
# Posted on: 25-Aug-2011 09:53:23   

My table name is Kisi (English means User)

KisiCollection kc = new KisiCollection(); IRelationCollection Iliski = new RelationCollection(); Iliski.Add(KisiEntity.Relations.TelefonEntityUsingKisiId, JoinHint.Left); ExcludeIncludeFieldsList gridgoster = new ExcludeIncludeFieldsList(true);

        gridgoster.Add(KisiFields.KisiId);
        gridgoster.Add(TelefonFields.TelefonId);
        gridgoster.Add(TelefonFields.KisiId);

        kc.GetMulti(null, 0, null, Iliski,null,gridgoster,0,0);
        dgvData.DataSource = kc;

I think is your answer

nevernet
User
Posts: 67
Joined: 01-Feb-2010
# Posted on: 25-Aug-2011 09:54:43   

Yes, great simple_smile

memedow
User
Posts: 5
Joined: 25-Aug-2011
# Posted on: 25-Aug-2011 10:01:01   

simple_smile