473,385 Members | 1,673 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,385 software developers and data experts.

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 1483
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
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...
0
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...
4
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,...
3
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...
1
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...
6
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...
1
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 ...
6
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...
0
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...
3
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.