473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using SQL aggregat functions with DataSets / DataViews

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
4 1783
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
thx!

it works now

May 16 '06 #3
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dan V. | last post by:
How can I use real SQL on a DataTable? i.e. not array of rows using a filter... as in DataTable.Select. I read at : microsoft.public.dotnet.framework.adonet "As others have posted: There is no...
0
by: garethdjames | last post by:
For scalability we wish to use disconnected DataSets and hold them in the application cache. This means that multiple concurrent users will be reading the data (its read only) The DataSet is...
4
by: Bernie Hunt | last post by:
I currently have a datagrid that I'm feeding with a DataSet, which contains three tables. I would like to use a DataView to format the DataTables but I'm not sure how to go about this. Currently...
14
by: Piotrek | last post by:
Hi all. I have a web app, in which I use frames. My main frameset consists of three inner frames. When some button is pressed in frame A, then content of frame B is reloaded. I am using such...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.