Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 16th, 2005, 01:56 PM
Authorized User
 
Join Date: May 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding rows, AND column(s) to existing datatable

Ok: Here is the background information:

I am running a VB.NET Windows application that buuilds a query based upon selections made from a form, and queries an ORACLE database via a somewhat complicated PIVOT query. The resulting dataset is filled, and then I bind it to a dataset, and everything works great.

The data resembles the following:

District Category COMPLETE INCOMPLETE SKIPPED
Cheshire A 1250 101 595
Cheshire B 751 37 122
Cheshire C 409 12 206
Hartford A 2842 175 822
Hartford B 1102 75 270
Hartford C 889 111 102


.... and so on.

What I would like to do is :

Add a row between each District and the next that gives the total for each of the three rows for each numeric column

The resulting datatable would look like this:

District Category COMPLETE INCOMPLETE SKIPPED
Cheshire A 1250 101 595
Cheshire B 751 37 122
Cheshire C 409 12 206
Total Cheshire 2410 150 923
Hartford A 2842 175 822
Hartford B 1102 75 270
Hartford C 889 111 102

and so on....

In thinking about this, I figured I could parse through the rows one by and calculate the running sums, but eventually getting the new rows into the datatable in the proper location might be problematic. As I unerstand it, the Newrow method for a datatable won't re-arrange them, just add them to the end of the table.


Any advice on how I should proceed to build these additional rows?





 
Old August 18th, 2005, 06:50 AM
Authorized User
 
Join Date: May 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

PROBLEM RESOLVED:

Thanks for looking.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a column to an existing SQL database table furjaw SQL Language 10 May 17th, 2007 06:35 PM
Adding up Column Values within a Datatable rit01 ASP.NET 2.0 Basics 1 May 31st, 2006 11:27 AM
Adding existing and non-existing attributes spencer.clark XSLT 5 July 27th, 2005 04:02 PM
Getting the Top 5 Rows from a datatable flyin General .NET 9 June 14th, 2004 08:36 AM
adding rows to datatable forkhead ADO.NET 2 March 18th, 2004 01:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.