Compartir a través de


SyncTable.TableName Propiedad

Obtiene o establece el nombre de la tabla en la base de datos cliente.

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

Sintaxis

'Declaración
Public Property TableName As String
'Uso
Dim instance As SyncTable
Dim value As String

value = instance.TableName

instance.TableName = value
public string TableName { get; set; }
public:
property String^ TableName {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_TableName ()

/** @property */
public void set_TableName (String value)
public function get TableName () : String

public function set TableName (value : String)

Valor de la propiedad

Nombre de la tabla en la base de datos cliente.

Ejemplo

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

SyncTable Clase
SyncTable Miembros
Microsoft.Synchronization.Data Espacio de nombres