I have this result table after my query
Id Per_Router Prod_No Rout_No
NULL 1 81253 77976
NULL 1 81235 77976
NULL 1 67907 77976
NULL 1 66772 77976
21202 2 NULL 77976
41978 1 NULL 77976
41979 1 NULL 77976
using LINQPAD I want to extract the whole hierarchy. As starting point 77976 but I want to get also for each sub-component ex. 81253, 81235, etc - recursive? Using query from db is very long to get each sub component record (Foxpro 6)
I declare my self a beginner in this
var query = from p in RoTable
where p.Rout_No.Contains("77976")
select new
{
p.Id,
p.Per_Router,
p.Prod_No,
p.Rout_No,
};
query.Dump();
Expected results:
Top Level start 77976
Id Per_Router Prod_No Rout_No
NULL 1 81253 77976
NULL 1 81235 77976
NULL 1 67907 77976
NULL 1 66772 77976
21202 2 NULL 77976
41978 1 NULL 77976
41979 1 NULL 77976
Sub-components of 81253
20373 11 NULL 81253
20377 1 NULL 81253
20379 1 NULL 81253
20388 4 NULL 81253
Sub-components of 81235
20265 1 NULL 81235
28957 1 NULL 81235
NULL 1 53755 81235
NULL 1 53788 81235
NULL 1 59516 81235
Sub-sub-components 53755
Sub-sub-components 53788
Sub-sub-components 59516
Sub-components of 67907
Sub-components of 66772
...
...
Can you give me a hint in this? The final code will be integrated into c# project.
See Question&Answers more detail:os