I have to move the column from Index ‘X’ to Index "Y’ in a datatable for processing,please help.
MyDataTable.Columns["MyColumn"].SetOrdinal(Y)
Hi
Hope this step could help you resolve
— use a INVOKE METHOD
Where in the Target object mention as
Yourdatatable.columns(“yourcolumnname”)
— in Target method mention as SetOrdinal
— in parameter property in property panel of Invoke method mention
Direction as In
Type as Int32
Value as 10
Simple isn’t it
Cheers @Ramki81
Use Invoke Code
activity:
-
Use as arguments:
- an In/Out DataTable with your datatable as value
- an In Integer with your column index as value.
-
Edit the script with your code.
You need to pass the datatable as argument allowing the script to access it and return it modified. You can hard code the column name and its index. You can put multiple column index changes. You can pass the values as argument if you prefer.
Thank you, it works.
Thank you , it works
Cheers @Ramki81
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.