I have one datatable which has more than 80000 records. It has 25 columns. One of the column lets say “Comment” has comma seperated value. Based on the value which is present in this column, I have to do some operation like update the data rows. For eg:- Comment → “E51,E87,E96,E78” . Based on each of this value, I have to update the rows… What is the fastest way to update it?. Can we use for each or linq?. Below query is not giving the results:
int rows= myDt.AsEnumerable.Where(Function(x)Split(x(“Comment”).ToString,“,”).Contains((“E51”)))).ToArray. Can someone help me on this?. Thank you
If you could share a sample input(just one value) and the expected output …we can try the LINQ query in the invoke code method…
@Robot227 - we can try something like below which uses LINQ (I am not sure this is the best approach or not)…
This is my datatable…
Invoke Code ===> Language - VbNet
dtinput.Select.ToList.ForEach(Sub(Row) Row(1) = Row(1).tostring.Replace("E15,","xyz,").replace("E16,","Hello"))
Output
Note: in your case replace row(1) to row(“description”)
Please give it a try.
Thank you. But my question is, I have datatable like below
Each of the description will have some values, based on that we should update comments column like below
I hope my question is clear now