Closes the connection to the database.
[Visual Basic] Overrides Public Sub Close() [C#] public override void Close(); [C++] public: override void Close(); [JScript] public override function Close();
Exception Type | Condition |
---|---|
ConnectionAlreadyClosed | The connection is already closed. |
PendingTransaction | A transaction is still processing. |
Exception | The connection could not be closed. |
The following example creates a connection, opens it, begins a transaction, saves the transaction, commits the transaction, rollsback the transaction, then closes the connection.
SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | Open