SubscriptionFieldCollection.Add Method (SubscriptionField, Int32)
Adds a SubscriptionField to the SubscriptionFieldCollection at the specified position.
Пространство имен: Microsoft.SqlServer.Management.Nmo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
Синтаксис
'Декларация
Public Sub Add ( _
subscriptionField As SubscriptionField, _
insertAtPosition As Integer _
)
public void Add (
SubscriptionField subscriptionField,
int insertAtPosition
)
public:
void Add (
SubscriptionField^ subscriptionField,
int insertAtPosition
)
public void Add (
SubscriptionField subscriptionField,
int insertAtPosition
)
public function Add (
subscriptionField : SubscriptionField,
insertAtPosition : int
)
Параметры
- subscriptionField
The SubscriptionField to add to the collection.
- insertAtPosition
A Int32 that specifies the zero-based position in the collection where you want to add the SubscriptionField object.
Замечания
This method allows you to insert a subscription field at a specific position in the subscription field list. Each subscription field becomes a column in a table. Depending on how you add subscriptions, the order of the columns can be important.
If you add a subscription field, updating the instance re-creates the subscription class to which it corresponds. Notification Services renames the existing subscription tables by appending "Old" to the table name and then creates new tables. Existing subscription table indexes are left unchanged.
Use the Update method to update the instance.
If you want to transfer data between the old and new subscription tables, it must be done manually. For more information, see Обновление приложения.
Пример
The following examples show how to define a subscription field and add it at the third position in the collection of subscription fields:
// Add a GoingTo field and add it at position 2
SubscriptionField subDestination =
new SubscriptionField(flightSubscriptions, "GoingTo");
subDestination.Type = "nvarchar(6)";
flightSubscriptions.SubscriptionFields.Add(subDestination, 2);
' Add a GoingTo field and add it at position 2
Dim subDestination As SubscriptionField = _
New SubscriptionField(flightSubscriptions, "GoingTo")
subDestination.Type = "nvarchar(6)"
flightSubscriptions.SubscriptionFields.Add(subDestination, 2)
Синхронизация потоков
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.
См. также
Справочник
SubscriptionFieldCollection Class
SubscriptionFieldCollection Members
Microsoft.SqlServer.Management.Nmo Namespace
Другие ресурсы
Определение схемы подписок
Field Element for Schema/Fields (ADF)