Mainid is not directly related with Referenceid but it is used to group the referenceid, if i give the parameter values as 2 i need the following result set
11
12
13
21
23
33
32
43
44
51
53
94
99
910
912
i will explain you now we achieve this, we need to find the groups where the value 2 lies so in our data
in mainid 1 and 3
i that group we have other reference id's so the result might be
11
12
13
33
32
now i have to do the same process again for the reference id 1 and 3 because these are siblings for the reference id 2
and the process is go on until i am not able find any records
os now for 1 the resultset will be
11
12
13
21
23
for 3 the result will be
11
12
13
21
23
33
32
43
44
because all the groups have the value 3
now form the result we have to find the result set for 4, it is
43
44
94
99
910
912
sin ce there is no result for the values 9 10 12 the loop ends here
if i give the parameter values as 5 or 6 or 7 then i want to return the following resultset
65
66
76
77
86
87
hope you got it to clarify me
Every rule in a world of bits and bytes, can be bend or eventually be broken
MyBlog About Common dialog control
A Visualizer for viewing SqlCommand object script [/url]