Hi Experts
Is it possible change the column names of Table B to the column names in Table A without using the For Each activity? Can it be done with using an Invoke Method activity?
Hi Experts
Is it possible change the column names of Table B to the column names in Table A without using the For Each activity? Can it be done with using an Invoke Method activity?
Hi
Hope this helps you
Here is an example of the code for the ChangeColumnName method you can use in Invoke method activity
public void ChangeColumnName(DataTable dataTable, string[] newColumnNames) { foreach (string newColumnName in newColumnNames) { dataTable.Columns(newColumnName).ColumnName = newColumnName; } }
Cheers @jacchr
@jacchr
dataTableB.Columns.Cast(Of DataColumn)().ToList().ForEach(Sub(col, index) col.ColumnName = dataTableA.Columns(index).ColumnName)
Thanks for your post - I cannot quite get it to work though.
How would it be done if I have a list of strings with the exact same amount of items as column names in my data table and then want to rename the column name with the value from the list of strings that has the same index?