I have a requirement where I have to update all the values in a specific column in a datatable. I.e. I have a column “TIN” which has value like “81919010” , I have to update it with 819-19-010. This should be done to all the values in that column. I can’t use for each row since the record count is very high.
Is there any LinQ I could use?
Thanks for the response Arjun.
Does this code insert “-” after 3rd and 5th character in string? Because, That is my requirement.
Also, What should be the Input argument for Invoke Code activity? It should just be my Datatable name on both sides ?
Yes, it does insert the character ‘-’ as per your requirement.
Regarding arguments for the Invoke code, you can send the same data table in/out direction, so that the modified data will be saved in the same data table.
This is the error I get arjun
I am not getting any error when I change it to VB in the invoke code and copy the VB code . Have you tried running the VB code as well ? Yielding the same result?
Maybe an alternate using Data Column Expressions could also work for your case. It does have the increase in the number of Steps to perform the operation and we could perform few selected operations, SUBSTRING being one of them which is your required operation.
The VB code which you shared is working as expected Arjun. C# faced an issue.
But just a small glitch in the Vb code.
You have provided fixed lengths right? 2,3,3. (i.e. 8 in total)
It isn’t working if the length of the value is more than 8. Irrespective of the length of the column value, I want it to put “-” after 3rd and 5th char.
Can you tweak the VB code a bit and let me know?