I have a Data Table with “Row No” column, I want to add a new column with decremental values of this pattern:

How can I do it with invoke code?
or any other way.
Thanks
I have a Data Table with “Row No” column, I want to add a new column with decremental values of this pattern:

How can I do it with invoke code?
or any other way.
Thanks
Hi,
How about the following?

dt.Columns.Add("Diff",GetType(Object))
dt.AsEnumerable.Where(Function(r) Int32.TryParse(r("New Row No").ToString,New Int32)).ToList.ForEach(Sub(r)
r("Diff") = CInt(r("RowNo").ToString)-CInt(r("New Row No").ToString)
End Sub
)
Sample
Sample20240913-1.zip (9.4 KB)
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.