• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 501
  • Last Modified:

VB.Net - DataTable Add Column and Perform Calculation

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
Jimbo99999
Asked:
Jimbo99999
1 Solution
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
By going through each row and doing that calculation. I don't believe there is an automatic way.
0
 
Jimbo99999Author Commented:
Thanks...have it working iterating through each row.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now