Author: elbasha | Posted on: 7/13/2010 3:44:04 PM | Views : 516

I have a dataset which is loaded by 1 table.  I want to add another datatable to it.  I tried every option online but I keep getting the same error:
System.ArgumentException: DataTable already belongs to another DataSet.


Solution for everyone was use... Clone()

Dim dsListingInfo as new dataset

Dim dsDataSet As New DataSet

dsDataSet = ........
dsDataSet.Tables(0).TableName = "TimeGraph1"

dsListingInfo.Tables.Add(dsDataSet.Tables("TimeGraph1").Clone())

dsListingInfo.Tables(1).TableName = "TimeGraph1"




Now when I do clone.. the table rows are all gone, I get 0 rows inputted on the new dataset.  What is another solution to this?


One thing I know i have the same is that dsListingInfo.Table(0) has the same column names as Tab ...

Go to the complete details ...