Condividi tramite


NotificationFieldCollection.Add Method (NotificationField, String)

Adds a NotificationField object to the NotificationFieldCollection before a named notification field.

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

Sintassi

'Dichiarazione
Public Sub Add ( _
    notificationField As NotificationField, _
    insertAtColumnName As String _
)
public void Add (
    NotificationField notificationField,
    string insertAtColumnName
)
public:
void Add (
    NotificationField^ notificationField, 
    String^ insertAtColumnName
)
public void Add (
    NotificationField notificationField, 
    String insertAtColumnName
)
public function Add (
    notificationField : NotificationField, 
    insertAtColumnName : String
)

Parametri

  • insertAtColumnName
    A String that specifies the name of the notification field before which to insert the new notification field.

Osservazioni

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.

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

Esempio

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

// Define a GoingTo field and add it before the Price field
NotificationField notificationDestination = 
    new NotificationField(flightNotifications, "GoingTo");
notificationDestination.Type = "nvarchar(6)";
flightNotifications.NotificationFields.Add(
    notificationDestination, "Price");
' Define a GoingTo field and add it before the Price field.
Dim notificationDestination As NotificationField = _
    New NotificationField(flightNotifications, "GoingTo")
notificationDestination.Type = "nvarchar(6)"
flightNotifications.NotificationFields.Add( _
    notificationDestination, "Price")

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

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

Altre risorse

Definizione dello schema delle notifiche
Field Element for Schema/Fields (ADF)