Dec 12, 2013

DataTable Compute

private void ComputeBySalesSalesID(DataSet dataSet)
{
    // Presumes a DataTable named "Orders" that has a column named "Total."
    DataTable table;
    table = dataSet.Tables["Orders"];

    // Declare an object variable. 
    object sumObject;
    sumObject = table.Compute("Sum(Total)", "EmpID = 5");
}
 

DataRow[] result = table.Select("Size >= 230 AND Sex = 'm'");
    foreach (DataRow row in result)
    {
        Console.WriteLine("{0}, {1}", row[0], row[1]);
    }



0 comments:

Post a Comment

Nam Le © 2014 - Designed by Templateism.com, Distributed By Templatelib