Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion


Dataset values with visual studio 2008

By Diaboloent ·
I need anybody help with this:

I have visual studio 2008
I have two different datasets that take values as "money". those datasets are in two different forms. I would like to collect each and every value of all different entries o the two datasets, and add them so that I can display the totals in a new form that has textboxes that displays the total of the two different datasets.
How do I go about doing so?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

There are lots of ways of doing that

by Tony Hopkinson In reply to Dataset values with visua ...

Are you are doing data entry in the forms and if so, are these totals for the data after the changes have been posted back?

If so the easiest way is to query them out

Look up the aggregate function Sum in SQL

If not and you want the current total if the changes were to be posted then you are going to have to cycle thru the dataset, add up the money, and then store it in class or struct that all three forms can see, youll also need some way of totalling up (one or both forms), if you haven't opened the datasets.

Depends on your UI, but it would be a lot easier if you only had two forms, one to do both detail sets and a total for each, and the Totals function could be a panel on the bottom, or a pop up or some such.

You could also instead of havng two (or even three datasets) just have one, with all the different doings in it.

If you want code, you might want to mention which language you are using in VS2008...

I suspect you are about to find out why I loathe datasets and prefer not to use them...

Related Discussions

Related Forums