Mayank Jani

Mayank Jani

  • NA
  • 477
  • 73.2k

How to run a loop within a loop?

Aug 17 2018 9:31 AM
Hii
I am working on a WinApp in C# using MS Access as database.
 
It is difficut for me to explain my problem but let me try... and please have some patience...
 
I want to fetch some rows from table A, the rows may be 2, 3, or 5 etc.
the data of the rows comes from a master table and I use serial number of the Items to save data in the table. I do this because to save memory and keep the table size as low as possible.
 
suppose, there are 3 rows with same serial number, I want to fetch all 3 records then accoding to the serial number, fetch the original items from the master table then to display the items in a DataGridView.
 
The problem is, the first row gets the item name and rest of all displays as serial number.
 
this is all I can explain... but I have try to explain it by screen shots.
Please see the screen shot...1.the query 2.the tables and output.
 
I think I have to run two loops but I dont know how to do that.
 
Please let me know if you want some other information.
 
Thanks
 
Mayank Jani

Attachment: TheProblem.zip

Answers (5)