I have a datatable table - dt
|User ID |Name |Type|
| 2 |fasil| | |
| 3 |Anandu | |
I need to update type as ‘ODD’ when Name= fasil and User ID = 2
Could anyone please provide a linq query to update so?
I have a datatable table - dt
|User ID |Name |Type|
| 2 |fasil| | |
| 3 |Anandu | |
I need to update type as ‘ODD’ when Name= fasil and User ID = 2
Could anyone please provide a linq query to update so?
Hi,
Hope the following helps you.
dtResult = dt.AsEnumerable.Select(Function(r) dt.Clone.LoadDataRow({r(0),r(1),if(r(0).ToString="2" AndAlso r(1).ToString="fasil","ODD","")},False)).CopyToDataTable()
Sample20220127-4.zip (2.6 KB)
regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.