예제 #1
0
        override public void Open()
        {
            if (StatisticsEnabled)
            {
                if (null == _statistics)
                {
                    _statistics = new SqlStatistics();
                }
                else
                {
                    _statistics.ContinueOnNewConnection();
                }
            }

            SqlStatistics statistics = null;

            try
            {
                statistics = SqlStatistics.StartTimer(Statistics);

                if (!TryOpen(null))
                {
                    throw ADP.InternalError(ADP.InternalErrorCode.SynchronousConnectReturnedPending);
                }
            }
            finally
            {
                SqlStatistics.StopTimer(statistics);
            }
        }
예제 #2
0
 private void PrepareStatisticsForNewConnection()
 {
     if (StatisticsEnabled)
     {
         if (null == _statistics)
         {
             _statistics = new SqlStatistics();
         }
         else
         {
             _statistics.ContinueOnNewConnection();
         }
     }
 }
예제 #3
0
 private void PrepareStatisticsForNewConnection()
 {
     if (StatisticsEnabled ||
         s_diagnosticListener.IsEnabled(SqlClientDiagnosticListenerExtensions.SqlAfterExecuteCommand))
     {
         if (null == _statistics)
         {
             _statistics = new SqlStatistics();
         }
         else
         {
             _statistics.ContinueOnNewConnection();
         }
     }
 }