jaheena jamal

jaheena jamal

  • NA
  • 83
  • 120.4k

loop for string

Feb 8 2011 3:48 AM

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




Answers (9)