Hi Team,
I am in particular trying to use LinQ to update a Datatable with name InputFileDT. My Aim is to update column 16 with the status “Successful” or “Failed” if Row(0) contains the TransactionItem.
(From row In InputFileDT.AsEnumerable
Let check = in_TransactionItem.SpecificContent("MyReference").ToString.All(Function (x) row(1).toString.ToUpper.Contains(x))
Let rpl = If(check,"Successful", row(16))
Let ra = New Object(){row(0),rpl,row(2)}
Select InputFileDT.Rows.Add(ra)).CopyToDataTable
I came across above Linq query and tried modifying it with my requirements but its giving me error as below:
I read post below but since Linq is still new to me, I was not able to understand much. Could anyone help me fix above. Basically I am trying to find a one liner code and understand it to update my datatable.
Collection was modified enumeration operation might not execute while adding a data row
Thanks