Hello Everyone,
Please share a linq query to split cell value in a column. Please refer to the below image
Input:
Required:
Hello Everyone,
Please share a linq query to split cell value in a column. Please refer to the below image
Input:
Required:
for each row in datable
row(“column1”)= row(“column1”).split("-"c)(0).tostring
need linq query please and i know how to do with for each
Thank you
with the reference to your previous question:
give a try at following:
Assign Activity
dtResult = dtOrig.Clone
Assingn Activity:
dtResult =
(From d in dtOrig.AsEnumerable
Group d by k=d("Column1").toString.Trim.Split("-"c).First() into grp=Group
Let sm = grp.Sum(Function (x) CInt(x("Column2").toString))
Let ra = new Object(){k,sm}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable
Thank you for quick response it working
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.