SqlDependency::Stop Method (String^)
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 )
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::Booleantrue 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. |
Available since 2.0