Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Latest commit

 

History

History
31 lines (21 loc) · 1.01 KB

097 Non-pooled SQL connections will leak memory if not explicitly disposed.md

File metadata and controls

31 lines (21 loc) · 1.01 KB

97: Non-pooled SQL connections will leak memory if not explicitly disposed

Scope

Edge

Version Introduced

4.5

Version Reverted

4.5

Source Analyzer Status

Not planned

Change Description

In the .NET Framework 4.5, non-pooled SQL connections which are not explicitly exposed (via Dispose, Close, or using) will leak memory

  • Quirked
  • Build-time break

Recommended Action

This issue is fixed in a .NET Framework 4.5 servicing update. Please update the .NET Framework 4.5, or upgrade to .NET Framework 4.5.1 or later, to fix this issue. Alternatively, this issue may be avoided by using the SqlConnection in a 'using' pattern (which is a best practice) or by explicitly calling Dispose or Close when the connection is no longer needed.

Affected APIs

  • M:System.Data.SqlClient.SqlConnection.#ctor(System.String)
  • M:System.Data.SqlClient.SqlConnection.#ctor(System.String,System.Data.SqlClient.SqlCredential)

Category

Data

More information