SqlDependency.Start Method (String)


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

Starts the listener for receiving dependency change notifications from the instance of SQL Server specified by the connection string.

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

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


Type: System.String

The connection string for the instance of SQL Server from which to obtain change notifications.

Return Value

Type: System.Boolean

true if the listener initialized successfully; false if a compatible listener already exists.

Exception Condition

The connectionString parameter is NULL.


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.


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


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.

This method starts the listener for the AppDomain for receiving dependency notifications from the instance of SQL Server specified by the connectionString parameter. This method may be called more than once with different connection strings for multiple servers.

For additional remarks, see Start.

.NET Framework
Available since 2.0
Return to top