SqlDependency::Stop Method (String^, String^)
.NET Framework (current version)
Stops a listener for a connection specified in a previous Start call.
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::Booleantrue 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. |
.NET Framework
Available since 2.0
Available since 2.0
Show: