This is my first time using ArrayList. I have tried to add to BarcodeArray (as an arraylist) and execution is failing with the error message:
Object reference not set to an instance of an object.
My code is shown below:
'Populate the arrays
BarcodeArray.Add(txt_Barcode.Text)
CategoryArray.Add(cmb_Categories.Text)
TitleArray.Add(txt_Title.Text)
DescriptionArray.Add(txt_Description.Text)
QuantityArray.Add(txt_Quantity.Text)
RRPArray.Add(txt_RRP.Text)
CostArray.Add(txt_Cost.Text)
This message appears when line 2 is executed. How do I add text to an ArrayList from a textbox without getting this error?
Productclass with the properties ofBarcode,Category, etc. Then you would populate aList(Of Product)which could contain all of those values for each product.