How to Auto Increment Datattable using linq Query Iam having 10k rows so for loop not possible

In datatble I have 10000 rows so need to auto increment one row using linq query kindly help

This may help


@J0ska Thanks for the reply.

But if i am not wrong this query is to add a increment column if i have all the data. but in my case i am merging orignal datatable’s data with another data tabel’s data. So that increment column must be increment.


Autoincrement column will increment it’s value as you are adding new rows to the datatable.
Just try it.