コード例 #1
0
        protected virtual void CloseConnection()
        {
            try { this.currentReader?.Close(); } catch { }
            try { this.currentReader?.Dispose(); } catch { }
            try { this.dbTransaction?.Dispose(); } catch { }
            try { this.DbConnection?.Close(); } catch { }

            this.DbConnection  = null;
            this.dbTransaction = null;
            this.currentReader = null;

            GC.SuppressFinalize(this);
        }
コード例 #2
0
		protected virtual void CloseConnection()
		{
			try { this.currentReader?.Close(); } catch { }
			try { this.currentReader?.Dispose(); } catch { }
			try { this.dbTransaction?.Dispose(); } catch { }
			try { this.DbConnection?.Close(); } catch { }

			this.DbConnection = null;
			this.dbTransaction = null;
			this.currentReader = null;

			GC.SuppressFinalize(this);
		}