string strConnectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=FooDB;Integrated Security=True"; using (SqlConnection conSQL = new SqlConnection(strConnectionString)) { using (SqlCommand cmdSQL = new SqlCommand("select * from Foo", conSQL)) { cmdSQL.CommandType = CommandType.Text; try { conSQL.Open(); conSQL.StatisticsEnabled = true; conSQL.ResetStatistics(); SqlDataReader drdActiveConfiguration = cmdSQL.ExecuteReader(); IDictionary idcStat= conSQL.RetrieveStatistics(); foreach (DictionaryEntry dceItem in idcStat) { Console.WriteLine("Key: {0}, Value: {1}", dceItem.Key.ToString(), dceItem.Value.ToString()); } DataSet dsActiveConfiguration = new DataSet(); dsActiveConfiguration.Load(drdActiveConfiguration, LoadOption.OverwriteChanges, new string[] { "Foo1" }); dsActiveConfiguration.Clear(); conSQL.Close(); } catch (Exception excp) { } } }