Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
| Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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 December 1st, 2007, 02:56 AM
Authorized User
 
Join Date: Oct 2007
Location: Hyderabad, Andhra Pradesh, India.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get the Sum of all the values in a column..

Hi All,

I am using a DataTable and have to get the sum of all the values in the columns ...The DataTable is dynamic and does not have a fixed number of columns... so can anyone suggest me a way where I can use the column index to identify it...



Thanks and Regards,
Jhansi
__________________
Thanks and Regards,
Jhansi
 
Old December 1st, 2007, 09:15 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You'll need to loop through the columns and rows and total them up.

-Peter




Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum a column at the group level? srussell705 SharePoint Development 0 October 3rd, 2007 08:40 AM
Using CASE in SUM column tnzabo Oracle 1 March 26th, 2007 10:29 AM
Sum a column from complex recordset shogg Access ASP 1 May 5th, 2005 07:29 AM
EASY ANSWER - sum of column in db nlicata Classic ASP Databases 4 August 8th, 2003 02:49 PM
Clarifying Previous question - Sum of DB Column nlicata Classic ASP Databases 0 August 4th, 2003 01:53 PM





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