ProtocolField Class
Represents a single protocol header field.
命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
語法
'宣告
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
備註
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
範例
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)
執行緒安全性
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 的硬體和軟體需求>。
請參閱
參考
ProtocolField Members
Microsoft.SqlServer.Management.Nmo Namespace