Solved

VB.Net - DataTable Add Column and Perform Calculation

Posted on 2015-02-03
2
480 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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