共用方式為


NotificationClass.ExpirationAge Property

Gets or sets the amount of time to elapse before unsent messages of the notification class are considered to have expired.

命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

語法

'宣告
Public Property ExpirationAge As TimeSpan
public TimeSpan ExpirationAge { get; set; }
public:
property TimeSpan ExpirationAge {
    TimeSpan get ();
    void set (TimeSpan value);
}
/** @property */
public TimeSpan get_ExpirationAge ()

/** @property */
public void set_ExpirationAge (TimeSpan value)
public function get ExpirationAge () : TimeSpan

public function set ExpirationAge (value : TimeSpan)

屬性值

A TimeSpan object that specifies the expiration age for notifications from the notification class.

備註

If no ExpirationAge value is specified, notifications never expire. Notification Services continues to attempt delivery of all notifications until the retry schedule is exhausted.

During delivery, Notification Services ignores any notifications that have expired per the ExpirationAge value.

To remove the expiration age value from a deployed application, you must set the value to TimeSpan.Zero.

範例

The following examples show how to set the expiration age for notifications generated for a notification class:

flightNotifications.ExpirationAge = new TimeSpan(2, 0, 0);
flightNotifications.ExpirationAge = New TimeSpan(2, 0, 0)

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

NotificationClass Class
NotificationClass Members
Microsoft.SqlServer.Management.Nmo Namespace

其他資源

定義通知類別
指定通知過期保留天數
ExpirationAge Element (ADF)