@SONYC
if you want to update a single value in all the rows of a specific column use the below code in Invoke Code Activity
For Each row As datarow In dt1.AsEnumerable
row(“YourColumnName”)=“Value”
If row(“ColumnName”).ToString.trim.Contains(“/”) Then
row(“ColumnName”).ToString=row(“ColumnName”).ToString.Replace(“/”,“”)
End If
Next
can you explain which value you need to update for all the rows in a particular
can you also share are there any fixed character which you need to replace
and also you need to replace the special character in any specific column or all
check with the below code and Try it once in invoke code
dt1.Columns.add(“NewColumn”)
For Each row As datarow In dt1.AsEnumerable
row(“NewColumn”)=row(1).ToString+row(4).ToString
If row(“ColumnName”).ToString.trim.Contains(“/”) Then
row(“ColumnName”)=row(“ColumnName”).ToString.Replace(“/”,“”)
End If
Next
For Each Row activity (TypeArgument: DataRow, Values: YourDataTable)
Assign activity:
row(“ColumnName”) = “YourSpecificValue”
Conditional Update
For Each Row activity (TypeArgument: DataRow, Values: YourDataTable)
Assign activity:
If row(“ColumnName”).ToString().Contains(“YourSpecificCharacter”)
Then
row(“ColumnName”) = row(“ColumnName”).ToString().Replace(“YourSpecificCharacter”, “ReplacementString”)
End If
Hello,
I tried implementing the solution, but I get the error below :
For Each row As datarow In dtData.AsEnumerable
If row(“BBPP”).ToString.Trim.Contains(““) Then
row(“BBPP”)=row(“BBPP”).ToString.Replace(””,“x”)
End If
Next
Can you exception message , the error message will be present in the locals ,when the exception occurs click on the locals panel
Before to that can you try this
dt1.Columns.add(“NewColumn”)
For Each row As datarow In dt1.AsEnumerable
row(“NewColumn”)=row(1).ToString+row(4).ToString
If row(“ColumnName”).ToString.trim.Contains(“/”) Then
row(“ColumnName”)=row(“ColumnName”).ToString.Replace(“/”,“”)
Else
row(“ColumnName”)=row(“ColumnName”).tostring
End If
Next