Compartir a través de


NotificationComputedFieldCollection.Add Method (NotificationComputedField)

Adds an NotificationComputedField to the NotificationComputedFieldCollection.

Espacio de nombres: Microsoft.SqlServer.Management.Nmo
Ensamblado: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintaxis

'Declaración
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
)

Parámetros

Notas

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

Ejemplo

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)

Seguridad para subprocesos

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.

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

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

Otros recursos

Definir el esquema de notificación
ComputedFields Element (ADF)