다음을 통해 공유


Disconnecting from an Instance of SQL Server

Manually closing and disconnecting SQL Server Management Objects (SMO) objects is not required. Connections are opened and closed as required.

Connection Pooling

When the Connect method is called, the connection is not automatically released. The Disconnect method must be called explicitly to release the connection to the connection pool. Also, you can request a non-pooled connection. You do this by setting the NonPooledConnection property of the ConnectionContext property that references the ServerConnection object.

Disconnecting from an Instance of SQL Server for RMO

Closing server connections when you are programming with RMO works slightly different from SMO.

Because the server connection for an RMO object is maintained by the ServerConnection object, this object is also used when disconnecting from an instance of Microsoft SQL Server when you program by using RMO. To close a connection by using the ServerConnection object, call the Disconnect method of the RMO object. After the connection has been closed, RMO objects cannot be used.

참고 항목

작업

How to: Get and Set a Property in Visual Basic .NET
How to: Set Various Properties Before an Object is Created in Visual Basic .NET
How to: Iterate Through All Properties of an Object in Visual Basic .NET

도움말 및 정보

SQL Server 2005 지원 받기