I created an arraylist differently than I have in the past. Now, I am having problems retrieving any information from the arraylist. Any ideas?
Code:
Dim CCConn = New System.Data.SqlClient.SqlConnection("server=server;uid=username;pwd=password;database=database")
Dim CQSQL As String = "SELECT order_no, p21_order_view.customer_id, customer_name, item_id, qty_ordered, required_date, "
CQSQL += "unit_price, extended_price, order_date FROM p21_customer_view, p21_order_view "
CQSQL += "WHERE (p21_order_view.company_id = p21_customer_view.company_id AND "
CQSQL += "p21_customer_view.customer_id = p21_order_view.customer_id) And p21_order_view.item_id='" & item & "' "
CQSQL += "and quote_flag='Y'"
'Throw New Exception(CQSQL)
Dim CQCommand As New System.Data.SqlClient.SqlCommand(CQSQL, CCConn)
Dim CQReader As System.Data.SqlClient.SqlDataReader
Dim CQArray As New ArrayList()
CCConn.open()
Try
CQReader = CQCommand.ExecuteReader()
Do
While CQReader.Read
Dim vals() As Object = New Object(CQReader.FieldCount) {}
CQReader.GetValues(vals)
CQArray.Add(vals)
End While
Loop While CQReader.NextResult()
Finally
CCConn = Nothing
End Try
'details
For x = 0 To CQArray.Count - 1 'newArr.GetUpperBound(0)
Response.Write("<tr><td>" & CQArray(0)& "</td>") ' I have tried .tostring and cqarray(x,0) but nothing works
'Response.Write("<td>" & cqarray(x,0) & "</td>")
'Response.Write("<td>" & cqarray(x,0) & "</td>")
'Response.Write("<td>" & cqarray(x,0) & "</td>")
'Response.Write("<td>" & cqarray(x,0) & "</td>")
'Response.Write("<td>" & cqarray(x,0) & "</td>")
'Response.Write("<td>" & cqarray(x,0) & "</td></tr>")
Next