DeliveryChannelCollection.Add Method
Adds a DeliveryChannel to the DeliveryChannelCollection.
Namespace: Microsoft.SqlServer.Management.Nmo
Assembly : Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
Syntax
'Declaration
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
)
Parameter
- deliveryChannel
The DeliveryChannel to add to the collection.
Hinweise
Each delivery channel must have a unique name.
If you modify instance components after creating the instance, you must Update the instance to apply the changes.
Beispiel
The following examples show how to define a delivery channel for the standard file delivery protocol and then add it to the collection of delivery channels for the 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)
Threadsicherheit
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.
Plattformen
Entwicklungsplattformen
Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.
Zielplattforme
Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.
Siehe auch
Verweis
DeliveryChannelCollection Class
DeliveryChannelCollection Members
Microsoft.SqlServer.Management.Nmo Namespace
Andere Ressourcen
Definieren von Übermittlungskanälen
DeliveryChannel Element (ICF)