DataTable values

  • Thread starter Thread starter Janaka
  • Start date Start date
J

Janaka

I've got a DataSet which I'd like to be able to get all the values out of
one of the DataTable columns. These may be either string or integer values.
What I'd like ideally is to be able to get each row in the column of the
DataTable into a typed array. Is there something similar to Split() that I
can use on one of these objects? Otherwise it requires me doing an
iterative loop through each row in the DataTable.
 
If working with a DataTable, looping through the rows is your only
alternative. However, it dowes seem that you may be wasting some cycles
using a DataSet, as you want your data put into an array. It would be more
efficient to use a DataReader to create your array. A DataReader is used
internally by the DataAdapter to build a DataSet. Unless you need all the
functionality of a DataSet, a DataReader will perform much faster.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top