Add all values in a column of a data table

we can do (add by the understanding of value retrieval):
arrValues =
YourDataTableVar.AsEnumerable.Select(Function (x) x(YourColNameIrIndex).ToString).toArray

it will return us a string array and will work when the datatype of the data column is a simple datatype as string, int32, double…

About LINQ have a look here as well:

1 Like