By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,781 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,781 IT Pros & Developers. It's quick & easy.

Using SQL aggregat functions with DataSets / DataViews

P: n/a
Hello!

I have the following problem:

I'm using a DataSet and i want to filter the data!
I know that there exists the DataView, but i only can use the
WHERE-Clause there, for example:

DataView dv = new DataView(myDataSource.Tables[0]);
dv.RowFilter = "id <= 100";

But i have to do more filtering, for example the SQL aggregat functions
like MIN(), MAX(), AVG()...

Is this possible???

May 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Try dataTable.Select("sum(f1) from t1");
Description of available funcions are there
http://msdn2.microsoft.com/en-us/lib...xpression.aspx
I have the following problem:
I'm using a DataSet and i want to filter the data!
I know that there exists the DataView, but i only can use the
WHERE-Clause there, for example:

DataView dv = new DataView(myDataSource.Tables[0]);
dv.RowFilter = "id <= 100";

But i have to do more filtering, for example the SQL aggregat functions
like MIN(), MAX(), AVG()...


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

May 16 '06 #2

P: n/a
thx!

it works now

May 16 '06 #3

P: n/a
ra********@gmx.at schrieb:
Hello!

I have the following problem:

I'm using a DataSet and i want to filter the data!
I know that there exists the DataView, but i only can use the
WHERE-Clause there, for example:

DataView dv = new DataView(myDataSource.Tables[0]);
dv.RowFilter = "id <= 100";

But i have to do more filtering, for example the SQL aggregat functions
like MIN(), MAX(), AVG()...

Is this possible???

Why don't you do it in the sql?
Much better for performance.

Lots of Greetings!
Volker
--
For email replies, please substitute the obvious.
May 16 '06 #4

P: n/a
When you are working with disconnected dataSet/DataTables (enterprise
applications) additional calls are not the good idea, because in depends on
performance.

You need perform as much as possble with data you have got

I have the following problem:
I'm using a DataSet and i want to filter the data!
But i have to do more filtering, for example the SQL aggregat functions
like MIN(), MAX(), AVG()...
Is this possible???

Why don't you do it in the sql?
Much better for performance.

Lots of Greetings!
Volker


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

May 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.