Partager via


ProtocolField Constructor (NotificationClassProtocol, String)

Initializes a new instance of the ProtocolField class with a parent NotificationClassProtocol and a field name.

Espace de noms: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntaxe

'Déclaration
Public Sub New ( _
    notificationClassProtocol As NotificationClassProtocol, _
    name As String _
)
public ProtocolField (
    NotificationClassProtocol notificationClassProtocol,
    string name
)
public:
ProtocolField (
    NotificationClassProtocol^ notificationClassProtocol, 
    String^ name
)
public ProtocolField (
    NotificationClassProtocol notificationClassProtocol, 
    String name
)
public function ProtocolField (
    notificationClassProtocol : NotificationClassProtocol, 
    name : String
)

Paramètres

  • name
    A String, between 1 and 128 characters in length, that specifies the name of the protocol field.

    You cannot change the name. To rename a protocol field, you must remove the field and the add a new field that has the new name.

Notes

Field names can contain letters, numbers, and the special characters _, #, @, and $. They must also conform to Microsoft SQL Server identifier conventions. For more information about SQL Server identifiers, see Identificateurs.

Exemple

The following examples show how to define a protocol field and add it to a protocol definition in a notification class:

ProtocolField smtpProtocolField1 = 
    new ProtocolField(smtpProtocol, "Subject");
smtpProtocolField1.SqlExpression = 
    "'Flight notification: '+CONVERT (NVARCHAR(30), GETDATE())";
smtpProtocol.ProtocolFields.Add(smtpProtocolField1);
Dim smtpProtocolField1 As ProtocolField = _
    New ProtocolField(smtpProtocol, "Subject")
smtpProtocolField1.SqlExpression = _
    "'Flight notification: '+CONVERT (NVARCHAR(30), GETDATE())"
smtpProtocol.ProtocolFields.Add(smtpProtocolField1)

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

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

Autres ressources

FieldName Element for Protocol/Fields/Field (ADF)
Spécification du nom et des champs du protocole de remise