Jaa


NotificationComputedFieldCollection.Add Method (NotificationComputedField)

Adds an NotificationComputedField to the NotificationComputedFieldCollection.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
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
)

Parameters

Remarks

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

Example

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)

Thread Safety

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.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

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

Other Resources

Defining the Notification Schema
ComputedFields Element (ADF)