Clone the data table structure

datatable

#1

Suppose I have a data table with 5 columns (3 string,2 int32)
I want to get another data table with same headers and same data types
Can I get it Using Build Data Table


#2

Hey @Sravya

DataTable.Clone Method():
Clones the structure of the DataTable, including all DataTable schemas and constraints.

Reference: https://msdn.microsoft.com/en-us/library/system.data.datatable.clone(v=vs.110).aspx

Nop just crete a new variable of datatable type then use Assign activity like below :slightly_smiling_face:
DataTable newTable = originalTable.Clone()

Regards…!!
Aksh


Comparing two columns in Excel sheet but not rowwise
#3

Thank You.I will try.


#4

Hi Aksh,
Suppose i want to copy all the data from one table to a new table, can below expression in Assign activity will do the work? Thanks!

DT.Select().CopyToDataTable.