Suggest a linq expression to add ' infront of second column of the DT

Hi @Gopi_Krishna1 ,

Try this

(From row In Final_Dt.AsEnumerable()
Let newValue = "'" & row.Field(Of String)("yourcolumn_name")
Let otherValues = row.ItemArray.Skip(1).Select(Function(x) "'" & x.ToString()).ToArray()
Select Final_Dt.Clone().Rows.Add({newValue}.Concat(otherValues).ToArray())
).CopyToDataTable()

Regards,
Vinit Mhatre

1 Like