Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SqlDependency::Stop Method (String^, String^)

 

Stops a listener for a connection specified in a previous Start call.

Namespace:   System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)

public:
[HostProtectionAttribute(SecurityAction::LinkDemand, ExternalThreading = true)]
static bool Stop(
	String^ connectionString,
	String^ queue
)

Parameters

connectionString
Type: System::String^

Connection string for the instance of SQL Server that was used in a previous Start call.

queue
Type: System::String^

The SQL Server Service Broker queue that was used in a previous Start call.

Return Value

Type: System::Boolean

true if the listener was completely stopped; false if the AppDomain was unbound from the listener, but there is at least one other AppDomain using the same listener.

Exception Condition
ArgumentNullException

The connectionString parameter is NULL.

InvalidOperationException

The method was called from within SQLCLR.

SecurityException

The caller does not have the required SqlClientPermission code access security (CAS) permission.

SqlException

And underlying SqlClient exception occurred.

The Stop method must be called for each Start call. A given listener only shuts down fully when it receives the same number of Stop requests as Start requests.

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft