Filter Problem in DataSet

  • Thread starter Thread starter LIN
  • Start date Start date
L

LIN

Hi,
I have a dataset which I am filling it using a procedure
The sturcture of the dataset table is

TranDate OrderValue
-------- ------------
01-01-2003 100
02-01-2003 110
03-01-2003 120
04-01-2003 100
05-01-2003 200
06-01-2003 300
07-01-2003 100
08-01-2003 100
....
....

I want to get filter the info for the info week wise

Week No Value
---------------------
1 430
2 ...
....

Using any filter condition is possible to get the info.
Since I am having the data in the dataset i don't want to go to db and get
the results

Need Help

LIN
 
you are not filtering, you want groupwise summary. better to perform at
database.

Rajesh patel
 
Hi,

The following article shows how to do achieve this grouping in a DataSet

326145 HOW TO: Implement a DataSet GROUP BY Helper Class in Visual C# .NET
http://support.microsoft.com/?id=326145

I hope this information is useful.

Kind regards,

Jamilu Abubakar [MSFT]
Microsoft
 
Lin,

It is possible to do aggregation of this type inside a dataset (for example,
to sum all of the orders on a specific date). However, there is not
built-in function for converting date to week number, which you would need.

If you can get the week number as a column when you query the database, then
you can set up a second table listing week numbers, and create a relation
between the second and first tables on the WeekNumber column. Then add a
new column to the second table with its Expression property set to
"Sum(Child.OrderValue)" (see help on DataColumn.Expression property). This
datatable should now contain the required info.

All in all, its a hell of a lot easier just to requery the database for the
information, and you can get it in one Select statement.

Ciao,
Neil.
 
Back
Top