I am trying to put a datatable into a dateset, which I then export to a CSV file. I am getting this error
DataTable already belongs to another DataSet. on the following line dsExport.Tables.Add(dtExport)
VB Code:
Using dtExport As DataTable = DirectCast(dgvSafetyGlasses.DataSource, DataTable) Using dsExport As New DataSet() dsExport.Tables.Add(dtExport) ExportDatasetToCsv(dsExport) End Using End Using
What am I doing wrong?




Reply With Quote