Partilhar via


Propriedade SyncTable.TableName

Obtém ou define o nome da tabela no banco de dados do cliente.

Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (em microsoft.synchronization.data.dll)

Sintaxe

'Declaração
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 da propriedade

O nome da tabela no banco de dados do cliente.

Exemplo

O exemplo de código a seguir é de uma classe derivada de SyncAgent. O código cria dois grupos de sincronização e três tabelas de sincronização. A tabela Customer é adicionada ao grupo Customer, e as tabelas OrderHeader e OrderDetail são adicionadas ao grupo Order. Todas as tabelas são somente para download. Se já existir uma tabela no cliente, ela será descartada e recriada durante a sincronização inicial. Para exibir esse código no contexto de um exemplo completo, consulte Como filtrar linhas e colunas.

//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)

Consulte também

Referência

Classe SyncTable
Membros SyncTable
Namespace Microsoft.Synchronization.Data