Поделиться через


DeliveryChannelArgumentCollection.Add Method

Adds a DeliveryChannelArgument to the DeliveryChannelArgumentCollection.

Пространство имен: Microsoft.SqlServer.Management.Nmo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Синтаксис

'Декларация
Public Sub Add ( _
    deliveryChannelArgument As DeliveryChannelArgument _
)
public void Add (
    DeliveryChannelArgument deliveryChannelArgument
)
public:
void Add (
    DeliveryChannelArgument^ deliveryChannelArgument
)
public void Add (
    DeliveryChannelArgument deliveryChannelArgument
)
public function Add (
    deliveryChannelArgument : DeliveryChannelArgument
)

Параметры

Замечания

The name of each delivery channel argument must be unique.

If you modify arguments after creating the instance, you must Update the instance to apply the changes.

Пример

The following examples show how to define a delivery channel argument and then add it to the collection of arguments:

// 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)

Синхронизация потоков

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.

См. также

Справочник

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

Другие ресурсы

Определение каналов доставки
Argument Element (ICF)