I was attempting to add a DataRow from an existing DataTable into a new DataTable.
Dim TempResultsFile As New DataSet
For Each Row As DataRow In TempResultsFile.Tables(0).Rows
‘Snip excess code
At the OeaaResults.Rows.Add(Row) line, I received the message “This row already belongs to another table”. Well duh, of course it belongs to another table. What’s your point?
But that kind of brilliant arguing did not solve my problem. Instead, I found http://www.geekzilla.co.uk/View37EB5230-5B79-4D00-800C-52D7A46CFB15.htm which did solve my problem. In the article, Paul says to use the DataTable.Import method instead of DataTable.Add. So I changed
and the error was resolved. Joy and happiness abound.