Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array/DataTable Problem

Status
Not open for further replies.

vonehle

Programmer
May 16, 2006
35
US
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.

Code:
For intCounter = 0 To objDT.Rows.Count - 1
            objDR = objDT.Rows(intCounter)
            decLineCost = (objDR("Cost") * objDR("Quantity"))
            decRunningTotal += decLineCost
            strLineCost(intCounter) = decLineCost.ToString
        Next
 
I've decided not to do it this way. I just can't figure out how to delete my own posts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top