| Author |
Displaying one to many records from DB
|
Farakh khan
Ranch Hand
Joined: Mar 22, 2008
Posts: 672
|
|
Hello,
There are many dept record in my db and each dept may have one or more than one record.
I am trying to fetch one dept and then to get this dept records that may be one or many. Please check this link that shows the wrong output whereas the expected output is at this Link
Here is my all code of the method
Thanks & best regards
|
 |
Farakh khan
Ranch Hand
Joined: Mar 22, 2008
Posts: 672
|
|
Can anybody please help me to fix the problem?
Best regards
|
 |
Bijesh Roy
Greenhorn
Joined: Jun 28, 2011
Posts: 8
|
|
Can you please try closing rs1? Looks like since you are not closing rs1 so previous department id's are also getting added next time....try closing rs1 once hopefully it will solve the issue.....
Please let me know the result.....
|
 |
Bijesh Roy
Greenhorn
Joined: Jun 28, 2011
Posts: 8
|
|
|
close rs1 just after closing ps1....
|
 |
Santhosh ayiappan
Ranch Hand
Joined: Jan 30, 2007
Posts: 70
|
|
Since you are reusing the variable "m2" for both the departments, it is retaining the values of the first department and carried to the second department. Try to reinitialize the variable m2 after the iteration of the first department is over.
Regards
Santhosh
|
 |
Farakh khan
Ranch Hand
Joined: Mar 22, 2008
Posts: 672
|
|
Dear Santhosh,
Thanks a lot. The problem fixed with initializing msg2 within while loop
Appreciated!!
Best regards
|
 |
 |
|
|
subject: Displaying one to many records from DB
|
|
|