Q: sum on datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

float tAmt = dataSet11.Tables[myTable].Compute("Sum(myAmount)", "");

I have this line in my code to calculate total myAmount field in my
datagrid. Now I need to do this conditional to another field in the datagrid.
Like “Sum(myAmount) where mySecondField =â€XXXXâ€â€. How can I do this?

Thanks,
 
Jim,

I don't have VS running so I don't know if this works but give it a try.

float tAmt =
dataSet11.Tables[myTable].select("mySecondField='XXXX'").Compute("Sum(myAmount)",
"");

Regards,

Daniel
 
Back
Top