Copy one datatable having Columns of different dataType to other and change the column Datatype

Hello friends,

I have a data table which have column with different dataType. I want to convert all column into string type and store in a different table for easy calculations.

Anyone please help me.

Thanks in advance.

Hi,

Can you try the following sample?

Create DataTable which has string type columns in advance, then

 dtResult = dt.AsEnumerable.Select(Function(r) dtResult.LoadDataRow(r.ItemArray.Select(Function(o) o.ToString).ToArray(),False)).CopyToDataTable()

Sample20231105-2L.zip (3.2 KB)

Regards,

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.