04-02-21 12:22 PM
private void ComputeBySalesSalesID(DataSet dataSet)
{
DataTable table;
table = dataSet.Tables["Collection"];
object sumObject;
sumObject = table.Compute("Sum(Numbers)", "");
}
Answered! Go to Answer.
04-02-21 02:24 PM
// Inputs:
// Collection (collection)
// Column Name (text)
//
// Outputs:
// Total (number)
//
Total = Collection.AsEnumerable().Sum(x => (decimal)x[Column_Name]);
I had to include System.Linq and System.Data.DataSetExtensions in the namespaces on the global code tab, as well as a reference to System.Linq.dll and System.Core.dll.
04-02-21 02:24 PM
// Inputs:
// Collection (collection)
// Column Name (text)
//
// Outputs:
// Total (number)
//
Total = Collection.AsEnumerable().Sum(x => (decimal)x[Column_Name]);
I had to include System.Linq and System.Data.DataSetExtensions in the namespaces on the global code tab, as well as a reference to System.Linq.dll and System.Core.dll.
04-02-21 03:26 PM
04-02-21 03:38 PM
Total = Collection.AsEnumerable().Sum(Function (x) CType(x(Column_Name), Decimal))
04-02-21 07:42 PM