Redigera

Dela via


SqlNotificationRequest Constructors

Definition

Creates a new instance of the SqlNotificationRequest class.

Overloads

SqlNotificationRequest()

Creates a new instance of the SqlNotificationRequest class with default values.

SqlNotificationRequest(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.

SqlNotificationRequest()

Creates a new instance of the SqlNotificationRequest class with default values.

public:
 SqlNotificationRequest();
public SqlNotificationRequest ();
Public Sub New ()

Remarks

If the parameterless constructor is used to create a SqlNotificationRequest object, that instance must have its UserData and Options properties initialized before assigning the object to a SqlCommand object's Notification property. The default values used by the constructor are NULL (Nothing in Visual Basic) for the UserData, an empty string for the Options, and zero for the Timeout.

See also

Applies to

SqlNotificationRequest(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.

public:
 SqlNotificationRequest(System::String ^ userData, System::String ^ options, int timeout);
public SqlNotificationRequest (string userData, string options, int timeout);
new System.Data.Sql.SqlNotificationRequest : string * string * int -> System.Data.Sql.SqlNotificationRequest
Public Sub New (userData As String, options As String, timeout As Integer)

Parameters

userData
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
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
Int32

The time, in seconds, to wait for a notification message.

Exceptions

The value of the options parameter is NULL.

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

Remarks

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.

See also

Applies to