Compartir a través de


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
    Get
    Set
'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);
}
member TableName : string with get, set
function get TableName () : String
function set TableName (value : String)

Valor de la propiedad

Tipo: System. . :: . .String
Nombre de la tabla en la base de datos cliente.

Excepciones

Excepción Condición
ArgumentException

value está vacío o ya existe una tabla con el nombre value en el grupo actual.

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 quitará 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