Closes the connection to the database.
[Visual Basic] MustOverride Public Sub Close() [C#] public abstract void Close(); [C++] public: virtual void Close() = 0; [JScript] public abstract function Close();
Exception Type | Condition |
---|---|
ADP.ConnectionAlreadyClosed | The connection was already in a closed state. |
Data.DBObjectState) | A transaction is still being processed. |
Notes to Inheritors: When overridden, Close will close the connection to the data source.
The following example creates a connection, opens it, begins a transaction, commits the transaction, rollsback the transaction, then closes the connection.
DBConnection Class | DBConnection Members | System.Data.Internal Namespace | Open