Condividi tramite


ProtocolField Class

Represents a single protocol header field.

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

Sintassi

'Dichiarazione
Public NotInheritable Class ProtocolField
    Inherits NamedSmoObject
public sealed class ProtocolField : NamedSmoObject
public ref class ProtocolField sealed : public NamedSmoObject
public final class ProtocolField extends NamedSmoObject
public final class ProtocolField extends NamedSmoObject

Osservazioni

Some protocol use protocol headers, such as the To header field for the Simple Mail Transfer Protocol (SMTP) delivery protocol. A ProtocolField object represents one protocol field for a delivery protocol.

A ProtocolField has a name and either a SqlExpression or a FieldReference. The FieldName and SqlExpression combination enables you to use a Transact-SQL expression to define the protocol field value. The FieldName and FieldReference combination enables you to use a value from a notification field as the protocol field value.

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.Management.Smo.SmoObjectBase
     Microsoft.SqlServer.Management.Smo.SqlSmoObject
       Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Nmo.ProtocolField

Esempio

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)

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

ProtocolField Members
Microsoft.SqlServer.Management.Nmo Namespace

Altre risorse

Impostazione del nome e dei campi del protocollo di recapito
Field Element for Protocol/Fields (ADF)