Need Line query to add "New" before each data in the "Name" Column

Input:

Name
Jhon
Keshav
Rony
Bhim

Expected Output:

Name
New_Jhon
New_Keshav
New_Rony
New_Bhim

Thanks in advance

Hi @Random_Bot ,
You can use the following LINQ query, to add (New_) before each data in the “Name”:

(From row In Final_Dt.AsEnumerable() Let newValue = "New_" & row.Field(Of String)("Name") Select Final_Dt.Clone().Rows.Add({newValue})).CopyToDataTable()

Regards,
Vinit Mhatre

Assign activity
dtResult = dtOrig.Clone

Assing Activity:
dtResult =

(From d in dtOrig.AsEnumerable
Let ra = new Object(){"New_" & d(0).toString.Trim}
Select r = dtResult.Rows.Add(ra)).CopyToDatTable

We recommend avoiding Blackboxing and also recommend to check out other approaches , as there is probably a better match
How to Update Data Column Values of a Data Table | Community Blog

Thanks @ppr and @Vinit_Mhatre for your help its working

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.