共用方式為


NotificationComputedFieldCollection.Add Method (NotificationComputedField)

Adds an NotificationComputedField to the NotificationComputedFieldCollection.

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

語法

'宣告
Public Sub Add ( _
    notificationComputedField As NotificationComputedField _
)
public void Add (
    NotificationComputedField notificationComputedField
)
public:
void Add (
    NotificationComputedField^ notificationComputedField
)
public void Add (
    NotificationComputedField notificationComputedField
)
public function Add (
    notificationComputedField : NotificationComputedField
)

參數

備註

If you add fields after deploying the instance, you must Update the instance to apply the changes.

範例

The following example shows how to define a computed field and then add it to the collection of computed fields:

NotificationComputedField computedPrice = 
    new NotificationComputedField(flightNotifications, 
    "FormattedPrice");
computedPrice.SqlExpression = "CONVERT(NVARCHAR(10), Price, 1)";
flightNotifications.NotificationComputedFields.Add(computedPrice);
Dim computedPrice As NotificationComputedField = _
    New NotificationComputedField(flightNotifications, _
    "FormattedPrice")
computedPrice.SqlExpression = "CONVERT(NVARCHAR(10), Price, 1)"
flightNotifications.NotificationComputedFields.Add( _
    computedPrice)

執行緒安全性

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 的硬體和軟體需求>。

請參閱

參考

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

其他資源

定義通知結構描述
ComputedFields Element (ADF)