SqlDependency::Start Method (String^)
Starts the listener for receiving dependency change notifications from the instance of SQL Server specified by the connection string.
Assembly: System.Data (in System.Data.dll)
public: [HostProtectionAttribute(SecurityAction::LinkDemand, ExternalThreading = true)] static bool Start( String^ connectionString )
Parameters
- connectionString
-
Type:
System::String^
The connection string for the instance of SQL Server from which to obtain change notifications.
Return Value
Type: System::Booleantrue if the listener initialized successfully; false if a compatible listener already exists.
| Exception | Condition |
|---|---|
| ArgumentNullException | The connectionString parameter is NULL. |
| InvalidOperationException | The connectionString parameter is the same as a previous call to this method, but the parameters are different. The method was called from within the CLR. |
| SecurityException | The caller does not have the required SqlClientPermission code access security (CAS) permission. |
| SqlException | A subsequent call to the method has been made with an equivalent connectionString parameter with a different user, or a user that does not default to the same schema. Also, any underlying SqlClient exceptions. |
Available since 2.0