SqlNotificationRequest 类

定义

表示对给定命令的通知的请求。Represents a request for notification for a given command.

public ref class SqlNotificationRequest sealed
public sealed class SqlNotificationRequest
type SqlNotificationRequest = class
Public NotInheritable Class SqlNotificationRequest
继承
SqlNotificationRequest

注解

此类提供对 SQL Server 2005 公开的查询通知服务的低级访问。This class provides low-level access to the query notification services exposed by SQL Server 2005. 对于大多数应用程序SqlDependency , 类提供了一种更简单的方法来使用查询通知。For most applications the SqlDependency class provides a simpler way of using query notifications. 但是, 如果您需要对通知发生的时间进行精细控制, 或者您需要自定义作为通知的一部分返回的消息数据, SqlNotificationRequest则类就是要使用的类。However, if you need fine control over when notifications occur, or you need to customize the message data returned as part of a notification, the SqlNotificationRequest class is the one to use.

构造函数

SqlNotificationRequest()

使用默认值创建 SqlNotificationRequest 类的新实例。Creates a new instance of the SqlNotificationRequest class with default values.

SqlNotificationRequest(String, String, Int32)

使用用户定义的字符串创建 SqlNotificationRequest 类的新实例,该字符串标识特定的通知请求、预定义的 SQL Server 2005 Service Broker 服务名以及(以秒来计算)超时时间。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.

属性

Options

获取或设置发送通知消息的 SQL Server Service Broker 服务名。Gets or sets the SQL Server Service Broker service name where notification messages are posted.

Timeout

获取或设置一个值,该值指定在操作超时之前,SQL Server 等待发生更改的时间。Gets or sets a value that specifies how long SQL Server waits for a change to occur before the operation times out.

UserData

获取或设置此通知的应用程序特定的标识符。Gets or sets an application-specific identifier for this notification.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅