// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Data; public class MainClass { public static void Main(string[] args) { DataSet ds = new DataSet(); ds.ReadXmlSchema(@"C:\ds.xsd"); ds.ReadXml(@"C:\ds.xml"); int count = (int)ds.Tables[0].Compute("COUNT(value)",""); long sum = (long)ds.Tables[0].Compute("SUM(value)",""); long avg = (long)ds.Tables[0].Compute("AVG(value)",""); Console.WriteLine(count + " " + sum + " "+ avg); } }