My problems is, let say:
I have 1 sql statement, after i loop it and get the data, my DataTable will have one records at row(0).
After 2nd times looping my sql statement, my 2nd data will replace the 1st time data at row(0).
How can it can let me add it add row(1).
Below is my code, Thanks
I have 1 sql statement, after i loop it and get the data, my DataTable will have one records at row(0).
After 2nd times looping my sql statement, my 2nd data will replace the 1st time data at row(0).
How can it can let me add it add row(1).
Below is my code, Thanks
VB.NET:
For Each DR In fromRST.Rows
For i = 6 To fromRST.Columns.Count - 1
valueTXN = DR(6)
If valueTXN IsNot Nothing Then
StrSQL = "Select * from WTCOMMENT where uniqueId ='" & valueTXN & "'"
DS = New DataSet
pmCon.QueryMe(StrSQL, DS, "WTCOMMENT")
If DS.Tables("WTCOMMENT").Rows.Count <> 0 Then
Dim DTnewTxn As New DataTable
For j = 0 To fromRST.Rows.Count - 1
pmCon.QueryMe(StrSQL, DTnewTxn)
DTtxn.Rows.Add(DTnewTxn.Rows(j).ItemArray)
Next
End If
End If
Next i
Next
Last edited by a moderator: