S
Shawn
Hi. I have 2 DataTables, dataTable1 and dataTable2. dataTable1 contains a
DataRow that I need to insert at index 5 in dataTable2. Here is my code:
For Each dataRow1 In dataTable1.Rows
If dataRow1.Item("id") = "3353" Then
dataRow2 = dataRow1
End If
Next
dataTable2.Rows.InsertAt(dataRow2, 5)
The line above gives me this error: System.ArgumentException: This row
already belongs to another table.
What is the right way to do this?
Thanks,
Shawn
DataRow that I need to insert at index 5 in dataTable2. Here is my code:
For Each dataRow1 In dataTable1.Rows
If dataRow1.Item("id") = "3353" Then
dataRow2 = dataRow1
End If
Next
dataTable2.Rows.InsertAt(dataRow2, 5)
The line above gives me this error: System.ArgumentException: This row
already belongs to another table.
What is the right way to do this?
Thanks,
Shawn