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.
Платформы
Платформы разработки
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
Целевые платформы
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
См. также
Справочник
NotificationClassProtocol Class
NotificationClassProtocol Members
Microsoft.SqlServer.Management.Nmo Namespace
Другие ресурсы
Fields Element for Protocol (ADF)
Настройка протоколов доставки