Hello Everyone
I am here cause i would like to delete a specifics columns in a DataTable with a linq .
So far i found this linq in the forum but doesnt work Yourdatatablename = Yourdatatablename.DefaultView.ToTable(False,”columnname1”, “columnname2”, “columnname3”).copytodatatable()
The issue of sintax was solved but the problem is that the linq is bringme only that columns and that i need its deleted that 3 columns not only keep that 3 Columns
The above syntax indicates that
→ YourDataTable is your DataTable variable.
→ False indicates that you don’t want distinct rows; you just want to remove columns.
→ "columnname1", "columnname2", and "columnname3" are the names of the columns you want to keep in the resulting DataTable.
Try this way instead:
ColumnNamestoRemove = {"ColumnName1","ColumnName2","ColumnName3"} ColumnNamestoRemove is of DataType Array(System.String)
For Each currentText in ColumnNamestoRemove
Remove Data Column Activity
-> Column Name -> currentText
-> From Data Table -> yourdatatablevariable
End For Each
Thank you so much for your explanation, i know how to do it with that activities its just like i would like to do it only in an assign activity but if is the only way, i will do