I want to remove all spaces from a specfic column in data table using linq query.
I want operation to be done in same data table variable instead of new variable.
Use the “Assign” activity to assign the column name to a variable. Let’s say the variable is named columnName.
Use the “For Each Row” activity to iterate through each row in the DataTable.
Inside the loop, use the LINQ query to remove spaces from the specific column. You can use the Replace method of the string to replace spaces with an empty string. The LINQ query will update the value in the same DataTable.Here’s an example of the LINQ query:
is a subrroutine and is not returning a value (void method). This is expressed by the compile message and the code statement cannot be used within an assign activity.
Where:
1 = CurrentRow(columnName)
2 = CurrentRow(columnName).ToString.Replace(" ","")
And columnName is pre-assigned to the name of the column where you want to remove the spaces