ProtocolField Constructor (NotificationClassProtocol, String)
Initializes a new instance of the ProtocolField class with a parent NotificationClassProtocol and a field name.
命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
語法
'宣告
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
)
參數
- notificationClassProtocol
The parent NotificationClassProtocol for the protocol field.
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.
備註
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 識別碼.
範例
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)
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
ProtocolField Class
ProtocolField Members
Microsoft.SqlServer.Management.Nmo Namespace
其他資源
FieldName Element for Protocol/Fields/Field (ADF)
指定傳遞通訊協定名稱與欄位