Re: problem copying columns
No, you can't add a column in another datatable to a new table. But you could use method "Clone" of DataTable class to do that.
Re: problem copying columns
use the code to add a column to the new dataTable
Code:
newdt.Columns.Add(dt.Columns(myint).ColumnName, dt.Columns(myint).DataType)
Re: problem copying columns
Thank you aniskhan, your code creates the correct column headings for me, but no data. Do I need to add the data row by row too?
Re: problem copying columns
Yes, you need to cpoy the data row by row.
Re: problem copying columns
Superb!!!Nice work......correct solution 100%