I wrote below LINQ to merge values of 2 columns into 1 by a delimiter and add the updated value in the new column, but this query is taking a lot of time to execute.
Expected data volume can be 300K to 400K rows
(From d In Dt_Table.AsEnumerable()
Let a = d("Check 1").ToString.Trim+"-"+d("Check 2").ToString.Trim
Let ra = d.ItemArray.Append(a).ToArray()
Select Dt_ClonedDt.Rows.add(ra)
).CopyToDataTable()
Can anyone please suggest some better more efficient LINQ query for the same functionality.
I believe you are trying to update a Column present in the Datatable, the value to update would be the Concatenation of two other Column values present.
If that is the case, Check with the Data Column Expression updation method like below :
Just a small update in the question, that I want to merge the values of the columns will this expression approach work in that case as well? also how to implement this I have a huge data set consisting of 200-400K rows.
Yes you are right, If suppose there are 3 columns col1,col2,col3 then I am concatenating values of col1 and col2 by a delimiter and updating the new value in col3
Have you Checked with this Expression, It should be done using an Assign Activity.
For more details on it’s implementation, Check the post mentioned by @ppr