Add same number into two rows

Hi Everyone.

I have datatable as attached excel file.

I want to add sequence number into rows as attached picture.

How to do that without loop row in datatable?? Such as Linq

Thanks in advance!
Book1.xlsx (8.3 KB)


Do you want to flll it at blank Number column? If so, the following helps you.


dt.AsEnumerable.Select(Function(r,i) dt.Clone.LoadDataRow({r("item"),Math.Floor(i/2)+1,r("Quantity")},False)).CopyToDataTable (9.8 KB)


1 Like

Thanks you very much!

1 Like

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