473,395 Members | 1,639 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,395 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 1484
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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: 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...
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.