returning results of sql query...
Posted on 2005-05-03
I need to loop through the CheckedArray and get the cost for the elements in the array. Here is what I have so far...
For i = 0 To CheckedArray.Length - 1
SQLStr = "SELECT Cost FROM tblProduct WHERE ProductCode = '" & CheckedArray(i) & "'"
MyCommand = New SqlCommand(SQLstr, dbConnection)
Numa = MyCommand.ExecuteScalar()
My question is:
1. How do I store the cost for all these items, perhaps in an array, and then sum them so I can use that value in other places?