Condividi tramite


NotificationComputedFieldCollection.Add Method (NotificationComputedField)

Adds an NotificationComputedField to the NotificationComputedFieldCollection.

Spazio dei nomi: Microsoft.SqlServer.Management.Nmo
Assembly : Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintassi

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

Parametri

Osservazioni

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

Esempio

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.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

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

Altre risorse

Definizione dello schema delle notifiche
ComputedFields Element (ADF)