Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.Net - DataTable Add Column and Perform Calculation

Posted on 2015-02-03
2
Medium Priority
?
494 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
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

972 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