Hi
I want to update IN in 5th column if 2nd column has India in it. Many such rows .
Can we use linq or any other way ?
Hi
I want to update IN in 5th column if 2nd column has India in it. Many such rows .
Can we use linq or any other way ?
Hi @S_Nitin
Code:
Dim dataTable As DataTable = DT ' Replace with the name of your DataTable variable
For Each row As DataRow In dataTable.Rows
' Check if the 2nd column contains "India"
If row(1).ToString().Contains("India") Then
' Update the 5th column with "IN"
row(4) = "IN"
End If
Next
BlankProcess13.zip (165.0 KB)
Hope this helps!!
You don’t need Linq or anything like that for such simple DataTable Manipulations.
Just do this:
CurrentRow(1).ToString.Contains("India")