Compartir a través de


SyncTables Propiedad

Obtiene un SyncTableCollection de objetos SyncTable, que contienen valores de configuración tales como la dirección de la sincronización.

Espacio de nombres:  Microsoft.Synchronization.Data
Ensamblado:  Microsoft.Synchronization.Data (en Microsoft.Synchronization.Data.dll)

Sintaxis

'Declaración
Public ReadOnly Property SyncTables As SyncTableCollection
    Get
'Uso
Dim instance As SyncConfiguration
Dim value As SyncTableCollection

value = instance.SyncTables
public SyncTableCollection SyncTables { get; }
public:
property SyncTableCollection^ SyncTables {
    SyncTableCollection^ get ();
}
member SyncTables : SyncTableCollection
function get SyncTables () : SyncTableCollection

Valor de la propiedad

Tipo: Microsoft.Synchronization.Data. . :: . .SyncTableCollection
Colección SyncTableCollection de objetos SyncTable

Ejemplos

El ejemplo de código siguiente procede de una clase derivada de SyncAgent. El código crea dos grupos de sincronización y tres tablas de sincronización. La tabla Customer se agrega al grupo Customer y las tablas OrderHeader y OrderDetail se agregan al grupo Order. Todas las tablas son de sólo descarga. Si una tabla ya existe en el cliente, se eliminará y se volverá a crear durante la sincronización inicial. Para consultar este código en el contexto de un ejemplo completo, vea Filtrar filas y columnas.

//Create two SyncGroups so that changes to OrderHeader
//and OrderDetail are made in one transaction. Depending on
//application requirements, you might include Customer
//in the same group.
SyncGroup customerSyncGroup = new SyncGroup("Customer");
SyncGroup orderSyncGroup = new SyncGroup("Order");

//Add each table: specify a synchronization direction of
//DownloadOnly.
SyncTable customerSyncTable = new SyncTable("Customer");
customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;
customerSyncTable.SyncGroup = customerSyncGroup;
this.Configuration.SyncTables.Add(customerSyncTable);

SyncTable orderHeaderSyncTable = new SyncTable("OrderHeader");
orderHeaderSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
orderHeaderSyncTable.SyncDirection = SyncDirection.DownloadOnly;
orderHeaderSyncTable.SyncGroup = orderSyncGroup;
this.Configuration.SyncTables.Add(orderHeaderSyncTable);           

SyncTable orderDetailSyncTable = new SyncTable("OrderDetail");
orderDetailSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
orderDetailSyncTable.SyncDirection = SyncDirection.DownloadOnly;
orderDetailSyncTable.SyncGroup = orderSyncGroup;
this.Configuration.SyncTables.Add(orderDetailSyncTable);
'Create two SyncGroups so that changes to OrderHeader
'and OrderDetail are made in one transaction. Depending on
'application requirements, you might include Customer
'in the same group.
Dim customerSyncGroup As New SyncGroup("Customer")
Dim orderSyncGroup As New SyncGroup("Order")

'Add each table: specify a synchronization direction of
'DownloadOnly.
Dim customerSyncTable As New SyncTable("Customer")
customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable
customerSyncTable.SyncDirection = SyncDirection.DownloadOnly
customerSyncTable.SyncGroup = customerSyncGroup
Me.Configuration.SyncTables.Add(customerSyncTable)

Dim orderHeaderSyncTable As New SyncTable("OrderHeader")
orderHeaderSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable
orderHeaderSyncTable.SyncDirection = SyncDirection.DownloadOnly
orderHeaderSyncTable.SyncGroup = orderSyncGroup
Me.Configuration.SyncTables.Add(orderHeaderSyncTable)

Dim orderDetailSyncTable As New SyncTable("OrderDetail")
orderDetailSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable
orderDetailSyncTable.SyncDirection = SyncDirection.DownloadOnly
orderDetailSyncTable.SyncGroup = orderSyncGroup
Me.Configuration.SyncTables.Add(orderDetailSyncTable)

Vea también

Referencia

SyncConfiguration Clase

SyncConfiguration Miembros

Microsoft.Synchronization.Data Espacio de nombres