1// Get Data
2string itemPartNumber;
3int itemQuantity;
4int iLoop = 2; // Skip the column title
5bool exitLoop = false;
6
7ClearList(ref bomList); //Clear my destination list
8
9while (!exitLoop)
10{
11 var itemPn = xlsSheet.Cells[iLoop,1].Value2;
12 var itemQu = xlsSheet.Cells[iLoop,2].Value2;
13
14 exitLoop = (itemPn == null);
15 if (!exitLoop)
16 {
17 itemPartNumber = (string) itemPn;
18 itemQuantity = Int32.Parse(itemQu.ToString());
19 ComponentPNQ itemList = new ComponentPNQ(itemPartNumber, itemQuantity);
20 bomList.Add(itemList);
21 iLoop++;
22 }
23}
24