Mono Class Library: System.Data.SqlClient.SqlConnection Overview | Members

System.Data.SqlClient.SqlConnection.Close Method

Close an open database connection.

public override void Close ()

Remarks

Calling this method closes a connection to a SQL Server or releases the connection back to the connection pool. The System.Data.SqlClient.SqlConnection state is set to closed.

Calling Close on a System.Data.SqlClient.SqlConnection instance that is not currently open is acceptable; no exception is raised.

If there are any pending transactions, they will be rolled back.

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0