Click here to Skip to main content
15,861,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem that is, I trying to retrieve data from database to the extent.
I explain very Clearly,
I have a table named: details.mdf
fields
sponsor,  nameofmember,  memberid, dateofjoining
Q0000     ashi           Q0001      12-20-2009
Q0000     sfgsf          Q0002      13-20-2009
Q0001     dghdh          Q0003      12-20-2009
Q0000     tyety          Q0004      12-20-2009
Q0001     gdhdgh         Q0005      12-20-2009
Q0003     gdh            Q0006      12-20-2009
Q0002     ghf            Q0007      12-20-2009

what can i do for result like this below:

sponsor of Q0006 , answer is : Q0003 and then who is the sponsor of Q0003 , answer is: Q0001 etc......
Thus dynamically retrieve the datas from database . I think, for this we can use loop. but I dont know what is the correct code for this purpose because of all the values are string . Please help me to retrieve datas in this manner?

thanks in advance
Posted

1 solution

Please check the following link, which has example:

http://www.eggheadcafe.com/software/aspnet/30998209/sql-2005-recursive-query.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900