Loop thru an array
Posted: Thu Jul 22, 2010 3:46 pm
I have data in a datagrid and an item number may appear more than once for a particular order. This is because when the order shipped the item was shipped in multiple boxes and therefore each line represents the qty shipped for that "box" for that item.
For example
Order # Item # Qty Shipped
123 456 24
123 456 24
123 789 12
124 456 10
I need to update a database with this information but I need to update Order 123 for item 456 the qty of 48, then update order 123 for item 789 the qty of 12, then update order 124 for item 456 the qty of 10.
How do I loop thru the array or tab-delimited data to summarize the qty? Which is better to use an array or tab-delimited list?
Thanks, Dan
For example
Order # Item # Qty Shipped
123 456 24
123 456 24
123 789 12
124 456 10
I need to update a database with this information but I need to update Order 123 for item 456 the qty of 48, then update order 123 for item 789 the qty of 12, then update order 124 for item 456 the qty of 10.
How do I loop thru the array or tab-delimited data to summarize the qty? Which is better to use an array or tab-delimited list?
Thanks, Dan