Try this:
private void ComputeBySalesSalesID(DataSet myDataSet){ // Presumes a DataTable named "Orders" that has a column named "Total." DataTable myTable; myTable = myDataSet.Tables["Orders"]; // Declare an object variable. object objSum; objSum = myTable.Compute("Sum(Total)", "EmpID = 5"); } private void CountBySalesQuantity(DataSet myDataSet){ // Presumes a DataTable named "Orders" that has a column named "Quantity." DataTable myTable; myTable = myDataSet.Tables["Orders"]; // Declare an object variable. object objSum; objSum = myTable.Compute("Count(Quantity)", "EmpID = 5"); }
No comments:
Post a Comment