how to perform sum up in DataTable?

A

angus

Hi all,

I would like to know how to perform something like

select sum(amt) from table where id>10

in DataTable,

assuming that i have a DataTable dtTable which stores the "select id, amt
from table"

i know that i can

Dim drTemps As DataRow() = dtTable.Select("id>10")

For each drTemp as DataRow in drTemps
' sum up logic here
Next

But is there any other method, supported by ado.net? thank you

Thank you.
 

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

Top