共用方式為


DistributorCollection.Add Method

Adds an Distributor to the DistributorCollection.

命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

語法

'宣告
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
)

參數

  • distributor
    The Distributor to add to the collection.

備註

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

範例

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)

執行緒安全性

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.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

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

其他資源

指定散發者設定
Distributor Element (ADF)