Yes I realize that I was a lil in the clouds in my post

What I want is to create an array with values from one column in the
dataset. And then one more array with data from column2.
I was first thinking maybe I should create an jagged array, but I realize
that I don't have to do that. SO then my question is how can I get lets
say
the third column into an array?. It is LDepth and the value of each row
into
array.
If in database I have 500 rows I then want an array with 500 indexes
holding
the values in LDepth
Best regards
Trond
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote
in message Hi,
I don;t understand well your question, are you trying to create an array
with the components of two of the columns?
if so there is no way of doing it afaik, you would have to iterate in
the
datarow collection.
now, regarding your target structure double[] [] maybe is not the
best
way
for store them. It seems more like a construction from C , what is
what
you
want?
Maybe the best for you is creating either a class or a struct with two
double components and then create an array with that, lie this:
struct MyStruct
{
double ldepth ;
double service;
MyStruct( double l, double s){ ldepth = l; service=s;}
}
MyStruct[] theArray;
//create it
theArray = new MyStruct[ theDataSet.Tables[0].Rows.Count ];
int i =0;
foreach( DataRow row in theDataSet.Tables[0].Rows )
{
theArray[ i++] = new MyStruct( Convert.ToDouble( row["XXX"]),
Convert.ToDouble( row["YYY"] );
}
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
I have a webservice that is returning a dataset. In dataset there is
a
table
with 4 columns. (LDate, LTime, LDepth and ServiceNumber)
I then try to read only 2 of the columns into array (double[][]
valuesArray

but i cant get it to work. It is LDepth and
ServiceNumber.
Both columns has numbers with decimals. As a newbee i am struggling
with
arrays

Best regards
Trond