Q: sum on datagrid

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,
 
D

Daniel Walzenbach

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top