DeliveryChannel を DeliveryChannelCollection に追加します。
名前空間: Microsoft.SqlServer.Management.Nmo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)
構文
'宣言
Public Sub Add ( _
deliveryChannel As DeliveryChannel _
)
public void Add (
DeliveryChannel deliveryChannel
)
public:
void Add (
DeliveryChannel^ deliveryChannel
)
public void Add (
DeliveryChannel deliveryChannel
)
public function Add (
deliveryChannel : DeliveryChannel
)
パラメータ
- deliveryChannel
コレクションに追加する DeliveryChannel です。
解説
すべての配信チャネルに一意な名前を付ける必要があります。
インスタンスを作成した後にインスタンス コンポーネントを変更した場合は、インスタンスに対して Update を実行して変更を適用する必要があります。
使用例
次の例は、標準ファイル配信プロトコルで使用する配信チャネルを定義し、Instance の配信チャネルのコレクションに追加する方法を示しています。
// Define a delivery channel that uses the built-in File protocol
DeliveryChannel fileChannel =
new DeliveryChannel(myInstance, "FileChannel");
fileChannel.ProtocolName = "File";
// Define and add arguments for the file delivery channel
DeliveryChannelArgument fileNameArg =
new DeliveryChannelArgument(fileChannel, "FileName");
fileNameArg.Value = sampleDirectory +
@"\Notifications\FileNotifications.txt";
fileChannel.DeliveryChannelArguments.Add(fileNameArg);
// Add the file delivery channel to the instance
myInstance.DeliveryChannels.Add(fileChannel);
' Define a delivery channel using the built-in File protocol
Dim fileChannel As DeliveryChannel = _
New DeliveryChannel(myInstance, "FileChannel")
fileChannel.ProtocolName = "File"
' Define and add arguments for the file delivery channel
Dim fileNameArg As DeliveryChannelArgument = _
New DeliveryChannelArgument(fileChannel, "FileName")
fileNameArg.Value = sampleDirectory + _
"\Notifications\FileNotifications.txt"
fileChannel.DeliveryChannelArguments.Add(fileNameArg)
' Add the file delivery channel to the instance
myInstance.DeliveryChannels.Add(fileChannel)
スレッド セーフ
この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォーム
開発プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
対象プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
参照
関連項目
DeliveryChannelCollection Class
DeliveryChannelCollection Members
Microsoft.SqlServer.Management.Nmo Namespace