Share via


DistributorCollection.Add Method

Adds an Distributor to the DistributorCollection.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public Sub Add ( _
    distributor As Distributor _
)
public void Add (
    Distributor distributor
)
public:
void Add (
    Distributor^ distributor
)
public void Add (
    Distributor distributor
)
public function Add (
    distributor : Distributor
)

Parameters

  • distributor
    The Distributor to add to the collection.

Remarks

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

Example

The following examples show how to create a distributor, define the distributor's properties, and then add it to the collection of distributors for an application:

// Define distributor for application
Distributor distributor = 
    new Distributor(myApplication, "Distributor");
distributor.SystemName = notificationServicesHost;
distributor.QuantumDuration = new TimeSpan(0, 0, 15);
distributor.ThreadPoolSize = 2;
myApplication.Distributors.Add(distributor);
' Define distributor for application
Dim distributor As Distributor = New Distributor( _
    myApplication, "Distributor")
distributor.SystemName = notificationServicesHost
distributor.QuantumDuration = New TimeSpan(0, 0, 15)
distributor.ThreadPoolSize = 2
myApplication.Distributors.Add(distributor)

Thread Safety

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.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

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

Other Resources

Specifying Distributor Settings
Distributor Element (ADF)