SUM OF DATAROW[]

  • Thread starter Thread starter Peter de Jongh
  • Start date Start date
P

Peter de Jongh

Hello

I have this little problem... I have a loop which does about 5000
cycles. In each an every loop i get a different datarow[] which can
sometimes contain 14000 rows. In each loop there is three columns of
which i want the sum. I dont know if there is an other way, but i use
a loop to run through the rows, and then calculate the total.

This ofcourse takles a while sometimes! Does anyone know if there is
another way which i can use to calculate the sum of a column in a
datarow[]???

I would appreciate any help!!!!

Thanks
Peter
 
Hi Peter,
why don't you use SQL to do it like:

select sum(column1),sum(column2),sum(column3) from TableName


Cheers
Benny
 
Hi Peter,

There is no other way AFAIK.
However, it shouldn't take that long to sum those rows.
What is your code like?

Miha
 
Back
Top