SqlNotificationRequest 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建类的新实例 SqlNotificationRequest 。
重载
| 名称 | 说明 |
|---|---|
| SqlNotificationRequest() |
使用默认值创建类的新实例 SqlNotificationRequest 。 |
| SqlNotificationRequest(String, String, Int32) |
使用用户定义的字符串创建类的新实例 SqlNotificationRequest ,该字符串标识特定通知请求、预定义的 SQL Server 2005 Service Broker 服务名称的名称以及以秒为单位的超时时间。 |
SqlNotificationRequest()
使用默认值创建类的新实例 SqlNotificationRequest 。
public:
SqlNotificationRequest();
public SqlNotificationRequest();
Public Sub New ()
注解
如果使用无参数构造函数创建对象SqlNotificationRequest,该实例必须在将对象SqlCommand分配给对象的Notification属性之前初始化其UserData属性和Options属性。 构造函数使用的默认值为 NULL(
另请参阅
适用于
SqlNotificationRequest(String, String, Int32)
使用用户定义的字符串创建类的新实例 SqlNotificationRequest ,该字符串标识特定通知请求、预定义的 SQL Server 2005 Service Broker 服务名称的名称以及以秒为单位的超时时间。
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)
参数
- userData
- String
包含此通知的应用程序特定标识符的字符串。 通知基础结构不使用它,但它允许将通知与应用程序状态相关联。 此参数中指示的值包含在 Service Broker 队列消息中。
- options
- String
一个字符串,其中包含发布通知消息的 Service Broker 服务名称,并且它必须包含数据库名称或 Service Broker 实例 GUID,该 GUID 将服务名称查找的范围限制为特定数据库。
有关参数格式 options 的详细信息,请参阅 Options。
- timeout
- Int32
等待通知消息的时间(以秒为单位)。
例外
参数的值 options 为 NULL。
options或userData参数的长度大于uint16.MaxValue或参数中的timeout值小于零。
注解
使用此构造函数可以初始化新 SqlNotificationRequest 实例、提供自己的标识符、SQL Server 2005 Service Broker 服务名称和超时值。