Is there an easier way to achieve the following?
var obj = from row in table.AsEnumerable()
select row["DOUBLEVALUE"];
double[] a = Array.ConvertAll<object, double>(obj.ToArray(), o => (double)o);
I'm extracting a column from a DataTable
and storing the column in an array of double
s.
Assume that table
is a DataTable
containing a column called "DOUBLEVALUE" of type typeof(Double)
.