using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace SqlStatistics
{
   class Program
   {
      static void Main(string[] args)
      {
         SqlConnection conn = new SqlConnection(
           @"data source=.\SQLExpress; initial catalog=SampleDB; Integrated Security=SSPI;");
         conn.StatisticsEnabled = true;
         conn.Open();

         Hashtable ht = (Hashtable)conn.RetrieveStatistics();
         foreach (string key in ht.Keys)
         {
            Console.WriteLine("{0} : {1}", key, ht[key]);
         }
         Console.ReadLine();
      }
   }
}
