SqlDependency.Stop Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

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

[HostProtectionAttribute(SecurityAction.LinkDemand, ExternalThreading = true)]
public static bool Stop(
	string connectionString
)

Parameters

connectionString
Type: System.String

Connection string for the instance of SQL Server 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 are 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

An 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: