if ‘relationship type’ column is ‘o&p’ and then i have to update that cell value with other column from same datatable ‘job relation career name’ for all the matched rows using linq query @Rahul_Unnikrishnan@Palaniyappan@Yoichi
dt.AsEnumerable.Where(Function(r) r("relationship type").ToString ="o&p").ToList.ForEach(
Sub(r)
r("relationship type")=r("job relation career name").ToString
End Sub
)
For Each row as Datarow in DT.Asenumerable
row(“job relation career name”)=If(row(“relationship type”).To string.Trim.Equals(“O&P”),row(“relationship type”).ToString,row(“relationship type”).ToString)
Next
Dim dict As Dictionary(Of String,String) = dt2.AsEnumerable.ToDictionary(Function(r) r(0).ToString,Function(r) r(1).ToString)
dt1.AsEnumerable.Where(Function(r) r("relationship type").ToString.Contains("O&P")).ToList.ForEach(
Sub(r)
If dict.ContainsKey(r("employee id").ToString) Then
r("o&p bp career name")=dict(r("employee id").ToString)
End If
End Sub
)
where bot has to match 'employee id ’ from two datatables
1.then filter with 'relationship type ’ = o&p in datatable 2
2. if now of rows =1 then update datatable 1 ‘o&p career name’ column with ‘job relationship career name’ from datatable 2 @ppr@Palaniyappan@Yoichi@Rahul_Unnikrishnan
thanks