DataTable class in .Net supports the calculation of a column by getting the values from other columns.
That means lets say I have a
DataTable as dtItems which is having three columns ItemName, Price, Quantity ,if I need to add another column as Total and the calculated value for this column will be Price* Quantity , this can be done easily without looping through all the rows, it will be automatically calculated during runtime " dtItems.Columns.Add("Total", typeof(int), "Price*Quantity"); ".