I have a datatable that keeps a running cost total of all items in the table. I'm trying to make it so I can also keep track of each individual line for future purposes. When I run it as shown below, I get an error that says "Object reference not set to an instance of an object." The error points to the line of code with the array.
VB.NET:
For intCounter = 0 To objDT.Rows.Count - 1
objDR = objDT.Rows(intCounter)
decLineCost = (objDR("Cost") * objDR("Quantity"))
decRunningTotal += decLineCost
[COLOR=red]strLineCost(intCounter) = decLineCost.ToString[/COLOR]
Next