tags:

views:

22

answers:

2

I have a sequence relationship:

A has many Bs. B has many Cs. C has many Ds.

They also make me so confused if there are more than 3 or 4,..tables.

So, how can i select all Cs that satify A.Id="1". (something likes finding all grandsons of a grandfather)

Thanks in advance.

A: 

I assume that you are using Linq-to-sql since you mention "table" in the topic.

var query = from c in context.C
            where c.b.a.id == "1"
            select c;
Anders Abel
A: 
var x = from a in aArray
        from b in a.bArray
        from c in b.cArray
        where a.id == "1"
        select c;
pdr