473,669 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cpmute values in Dataset Table??

Does anyone know how i can compute values from dataset table before
assigning datagrid source to it???
My data table looks something like this.

DATE CAT STEP VALUE
---------------------------------------------------------------------------
01/16/2006 AAA1 50 1
01/16/2006 AAA1 50 1
01/16/2006 AAA1 50 1
01/16/2006 AAA1 50 1
01/16/2006 AAA1 100 2
01/16/2006 AAA1 100 2
01/16/2006 AAA1 100 2
01/16/2006 AAA1 100 2
01/17/2006 BBB1 50 3
01/17/2006 BBB1 50 3
01/17/2006 BBB1 50 3
01/17/2006 BBB1 50 3
01/17/2006 BBB1 100 4
01/17/2006 BBB1 100 4
01/17/2006 BBB1 100 4
01/17/2006 BBB1 100 4

What i want to do is to be able to sum "VALUE" for each step & date.

Final Output:

DATE CAT STEP VALUE
---------------------------------------------------------------------------
01/16/2006 AAA1 050 4
01/16/2006 AAA1 100 8
01/17/2006 BBB1 050 12
01/17/2006 BBB1 100 16

Thanks for your help!

Jan 18 '06 #1
5 1494
Can you just write an SQL statement to grab the sum and then add to the
dataset?

Jan 18 '06 #2
Jaawaad,

Compute gives the values in Net alone for a complete datatable.

Probably can this sample help you to do it, although you have now to sum the
values in the for index loop.

http://www.vb-tips.com/default.aspx?...2-1a580eb893b2
I hope this helps,

Cor
Jan 18 '06 #3
This data table is a result of a SQL query which i cant change....so i
was wondering if there is a way to query a dataset table or view?

Jan 18 '06 #4
This data table is a result of a SQL query which i cant change....so i
was wondering if there is a way to query a dataset table or view?

Jan 18 '06 #5
Cor, thanks...i will look into this example. Althoght, i was wondering
if there was an easy way to query dataset table and make a new table
out of the result.

Jan 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3284
by: Programmer | last post by:
Hi All Here is my problem I'm using a SQLDataAdapter and DataSet I use the method FillSchema(myDataset, SchemaType.Source) The problem is that when i Check the default Values of the Dataset i can see that the DefaultValue of the columns is system.dbnull!!!! But in SQL Server i have put as default values in a bigint field the '0' and
0
3190
by: Morné | last post by:
Hi how do I validate a text value in a datagrid e.g. the user is only allowed to type in a Y or a N. I specifically have a problem with using the PropertyDescriptorCollection. I get the following error: "Additional information: Cannot create a child list for field Query." Below my existing code:
4
3217
by: JohnR | last post by:
Hi, I'm trying to update a DBF file which I'm using VB.NET ODBC adapters, commands and connections. I fill the dataset and databind the columns to textboxes on my form. I can successfully view, delete and update the records. The problem is when I try to add a new record. Because I actually have a few controls bound to the same table I use FORM.BINDINGCONTEXT to keep it all synced. So, using the form.bindingcontext.addnew method. my...
3
2280
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather than the key value that are stored in the table. It works well if the comboboxes are selected when the row is created.
1
2728
by: tg.foobar | last post by:
my setup: visual studio 2005 sql server 2000 i'm using a dataset (used to be called typed dataset in 2003), where i use the MSDataSetGenerator to create a class for me based on the scheme of my SQL server. This schema doesn't include the default values that are defined in the SQL server. It's setting all the default values to NULL. is thre an easy way to get around this? for example, i have a
6
14904
by: Marcel Hug | last post by:
Hi all ! I have a table in my database, which has 3 attributes. IDFailureControl, ControlDate and ControlVersion. In the following function I test, if the date of today allready exists. Then I would like to write the new ControlDate or Version into the database. First i update the dataset, then i create a Insertcommand and call the update-methode. All datas are in the database, but.... 1.) If I only use the InsertCommand, without...
1
251
by: jaawaad | last post by:
Does anyone know how i can compute values from dataset table before assigning datagrid source to it??? My data table looks something like this. DATE CAT STEP VALUE 01/16/2006 AAA1 50 1 01/16/2006 AAA1 50 1 01/16/2006 AAA1 50 1 01/16/2006 AAA1 50 1 01/16/2006 AAA1 100 2
6
3849
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called "Generations"), and it allows the user to add, edit and delete the various records of the table. "Generations" table has the following fields: "IDPerson", NamePerson", "AgePerson" and "IDParent". A record contains the information about a person (his name, his...
0
1298
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005 and .net 2.0. I have used 2 DirectorySearchers to retrieve Active Directory data and put them into 2 separate dataset tables. I want to create a 3rd dataset table by using the equivalent of SQL join operation. This 3rd table will then be passed into Crystal Report. 1. Sometimes each table could contain 100,000 records or more. Is this the most efficeint way to do this? 2. Since there is no join query for dataset...
3
1643
by: Spectre1337 | last post by:
Hello, I've encountered a rather puzzling problem with SqlDataAdapter. I've set up a number of elaborate tables in the Microsoft SQL Server Management Studio Express (including several table key relationships), and I've been successfully accessing all of that information through the classes generated by the "visual" DataSet file in Web Developer Express (Solution > Add New Item > Data Set). Prior to my last code modification I've...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8588
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.