Call format:
Object DataTable.Compute (String Expression, String Filter);
Parameters: Expression: Expression Filter to be calculated: To calculate the filter condition example of the expression: (C #) Object objsum = DataTable.Compute ("SUM (FieldName", "True"); (VB.NET) DIM OBJSUM AS ObjDect Objsum = DATATABLE.Compute ("SUM (FieldName", "true") then, using Convert's related sub-function conversion specified data type If statistics meet a certain number of records: Compute ("count (*)", "Value = 1") Summary: Compute ("AVER (FieldName", "true") Seeking expression and: If you want to ask an expression, such as Quantity and Price, you want to ask for total price, The above method is not easy to implement, but you can do this: 1. Create a field in DATATABLE (New COLMNS) DIM DC AS Datacolumn DC = New Datacolumn ("Total", Type.getType ("System.double" 2, set new COLUMNS attributes Expression (expressions) for: Quantity and Price DC.Expression = "Quantity * Price" table.columns.add (dc) me.dataGrid.DataSource = Table3, the total price and: Compute ("SUM (Total", "True");