Compartir a través de


NotificationFieldCollection.Add Method (NotificationField, Int32)

Adds a NotificationField object to the NotificationFieldCollection at the specified position.

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

Sintaxis

'Declaración
Public Sub Add ( _
    notificationField As NotificationField, _
    insertAtPosition As Integer _
)
public void Add (
    NotificationField notificationField,
    int insertAtPosition
)
public:
void Add (
    NotificationField^ notificationField, 
    int insertAtPosition
)
public void Add (
    NotificationField notificationField, 
    int insertAtPosition
)
public function Add (
    notificationField : NotificationField, 
    insertAtPosition : int
)

Parámetros

  • insertAtPosition
    A Int32 that specifies the zero-based position of the collection to add the NotificationField object.

Notas

This method allows you to insert a notification field at a specific position in the notification field list. Each notification field becomes a column in a table. Depending on how you submit notification data, the order of the columns can be important.

The notification field currently at the position, and all subsequent notification fields, are moved down the list.

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

Ejemplo

The following examples show how to add a notification field as the second field in the collection of notification fields for a notification class:

// Define a Price field and add it at position 1 in the collection
NotificationField notificationPrice = 
    new NotificationField(flightNotifications, "Price");
notificationPrice.Type = "float";
flightNotifications.NotificationFields.Add(notificationPrice, 1);
' Define a Price field and add it at position 1 
' in the collection.
Dim notificationPrice As NotificationField = _
    New NotificationField(flightNotifications, "Price")
notificationPrice.Type = "float"
flightNotifications.NotificationFields.Add( _
    notificationPrice, 1)

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

NotificationFieldCollection Class
NotificationFieldCollection Members
Microsoft.SqlServer.Management.Nmo Namespace
Instance.Update Method

Otros recursos

Definir el esquema de notificación
Field Element for Schema/Fields (ADF)