Hello,
I'm trying to pass a DataTable back from a function, and would like to incorporate it into another DataSet. This is my function:
Code:
Function GetData(...) as DataTable
...
objAdapter.Fill(objDataSet, "Data")
return objDataSet.Tables("Data")
End Function
I want to insert the table into a new dataset back in the caller (because I got to call 4 GetData() methods in different classes). I am having problems, because I can't use the notation
Code:
objDataSet.Tables.Add(objTable)
because it says the table belongs to another dataset. So I changed it to do
Code:
objDataSet.Tables.Add(objTable.Clone())
, but the Clone() method only clones the structure, so I lose the data, and you can't clone each row separately...
Any ideas?
Thanks,
Brian Mains