다음을 통해 공유


NotificationClassProtocol.ProtocolFields Property

Gets the collection of protocol header field definitions for the delivery protocol.

네임스페이스: Microsoft.SqlServer.Management.Nmo
어셈블리: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

구문

‘선언
Public ReadOnly Property ProtocolFields As ProtocolFieldCollection
public ProtocolFieldCollection ProtocolFields { get; }
public:
property ProtocolFieldCollection^ ProtocolFields {
    ProtocolFieldCollection^ get ();
}
/** @property */
public ProtocolFieldCollection get_ProtocolFields ()
public function get ProtocolFields () : ProtocolFieldCollection

속성 값

A ProtocolFieldCollection object that represents the protocol header fields for the delivery protocol.

주의

Header fields are technically optional, but may be required by specific delivery protocols. For example, the built-in Simple Mail Transfer Protocol (SMTP) delivery protocol requires Subject, From, and To fields.

If you update the fields, updating the application deletes and re-creates the notification class to which it corresponds. This includes dropping and re-creating the Microsoft SQL Server tables used by this notification class. Any data existing in the existing notification class tables is permanently deleted.

The following examples show how add a protocol field that references a notification field. The field is added at a specific position in the protocol field collection:

ProtocolField fileProtocolField3 = 
    new ProtocolField(fileProtocol, "Price");
fileProtocolField3.FieldReference = "FormattedPrice";
fileProtocol.ProtocolFields.Add(fileProtocolField3, 1);
Dim fileProtocolField3 As ProtocolField = _
    New ProtocolField(fileProtocol, "Price")
fileProtocolField3.FieldReference = "FormattedPrice"
fileProtocol.ProtocolFields.Add(fileProtocolField3, 1)

The following examples show how add a protocol field that uses an expression to compute the value. The field is added to the end of the collection:

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)

스레드 보안

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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

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

관련 자료

Fields Element for Protocol (ADF)
배달 프로토콜 구성