Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.Net - DataTable Add Column and Perform Calculation

Posted on 2015-02-03
2
Medium Priority
?
489 Views
Last Modified: 2015-02-03
Good Day Experts!

I have a little project going on here that I am looking for a bit of help on.  I have a DataTable that is filled with query results from a SQL query.  Once I fill that DataTable I would like to add a column to the DataTable and then put in the column the value of subtracting 2 columns that were already present in the DataTable.  

I have added the column.  But now how do I subtract two columns in the DataTable and put the results in this new column:

tblGetExportReseachFinal.Columns.Add("Count Remaining", Type.GetType("System.Integer"))

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 2000 total points
ID: 40586545
By going through each row and doing that calculation. I don't believe there is an automatic way.
0
 

Author Comment

by:Jimbo99999
ID: 40586846
Thanks...have it working iterating through each row.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question