DbConnection.Dispose 方法

定義

多載

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

Dispose(Boolean)

釋放 DbConnection 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

C#
public void Dispose ();

實作

適用於

.NET Core 1.1 及其他版本
產品 版本
.NET Core 1.0, Core 1.1
UWP 10.0

Dispose(Boolean)

釋放 DbConnection 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。

C#
protected virtual void Dispose (bool disposing);

參數

disposing
Boolean

true 表示釋放 Managed 和 Unmanaged 資源,false 則表示只釋放 Unmanaged 資源。

適用於

.NET Core 1.1 及其他版本
產品 版本
.NET Core 1.0, Core 1.1
UWP 10.0