This documentation is archived and is not being maintained.

SqlNotificationRequest Constructor (String, String, Int32)

Creates a new instance of the SqlNotificationRequest class with a user-defined string that identifies a particular notification request, the name of a predefined SQL Server 2005 Service Broker service name, and the time-out period, measured in seconds.

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

public SqlNotificationRequest(
	string userData,
	string options,
	int timeout
)

Parameters

userData
Type: System.String
A string that contains an application-specific identifier for this notification. It is not used by the notifications infrastructure, but it allows you to associate notifications with the application state. The value indicated in this parameter is included in the Service Broker queue message.
options
Type: System.String
A string that contains the Service Broker service name where notification messages are posted, and it must include a database name or a Service Broker instance GUID that restricts the scope of the service name lookup to a particular database.
For more information about the format of the options parameter, see Options.
timeout
Type: System.Int32
The time, in seconds, to wait for a notification message.

ExceptionCondition
ArgumentNullException

The value of the options parameter is NULL.

ArgumentOutOfRangeException

The options or userData parameter is longer than uint16.MaxValue or the value in the timeout parameter is less than zero.

This constructor allows you to initialize a new SqlNotificationRequest instance, providing your own identifier, the SQL Server 2005 Service Broker service name, and a time-out value.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: