locked
Getting Error :unable to find a SyncAdapter for the specified SyncTable; the table name is null or empty in N-tier Synchronization RRS feed

  • Question

  • Hi...

    I was trying to implement N-Tier Synchronization with WCF but getting the Error in the ApplyChanges Event in the Client Side...I am using SQL Express 2008 as Client

    The error I am getting is As follows :---

    Table name 'tblParameters' is not valid.
    This might be caused by one or more of the following issues: 
    unable to find a SyncAdapter for the specified SyncTable;
    the table name is null or empty;
    or the table name contains the keywords SET, FMTONLY, and OFF."

    The Event looks like this :--

     

    public override SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)

    {

     

    //Map SyncDirection from client POV to our internal server POV

     

    foreach (SyncTableMetadata tableMetadata in groupMetadata.TablesMetadata)

    {

     

    if (tableMetadata.SyncDirection == SyncDirection.DownloadOnly || tableMetadata.SyncDirection == SyncDirection.Snapshot)

    {

     

    //This SyncDirection DownloadOnly/Snapshot is from a Client point of view. But our client is inturn a Server provider. Hence switch this to UploadOnly

    tableMetadata.SyncDirection =

    SyncDirection.UploadOnly;

    }

     

    else if (tableMetadata.SyncDirection == SyncDirection.UploadOnly)

    {

     

    //This SyncDirection UploadOnly is from Client POV. But our client is inturn a Server provider. Hence switch this to DownloadOnly

    tableMetadata.SyncDirection =

    SyncDirection.DownloadOnly;

    }

    }

     

    // neet to set the LastReceivedAnchor as the LastSentAnchor since

     

    // DbServerSyncProvider operates from the server's perspective, so

     

    // we swap the two fields temporarily.

     

    // Note that even if we do this, the NewAnchor value will be the one

     

    // from the server, not local which is invalid since the client and server

     

    // clocks are always at least the tiniest bit misaligned

     

    foreach (SyncTableMetadata metaTable in groupMetadata.TablesMetadata)

    {

     

    SyncAnchor temp = metaTable.LastReceivedAnchor;

    metaTable.LastReceivedAnchor = metaTable.LastSentAnchor;

    metaTable.LastSentAnchor = temp;

    }

     

    SyncContext syncContext = _dbSyncProvider.ApplyChanges(groupMetadata, dataSet, syncSession);

     

    //swap them back for consistency

     

    foreach (SyncTableMetadata metaTable in groupMetadata.TablesMetadata)

    {

     

    SyncAnchor temp = metaTable.LastReceivedAnchor;

    metaTable.LastReceivedAnchor = metaTable.LastSentAnchor;

    metaTable.LastSentAnchor = temp;

    }

     

    foreach (SyncTableMetadata table in groupMetadata.TablesMetadata)

    {

    SetTableReceivedAnchor(table.TableName, groupMetadata.NewAnchor);

    }

     

    return syncContext;

    }

    I am getting  the error in the line :--
    SyncContext syncContext = _dbSyncProvider.ApplyChanges(groupMetadata, dataSet, syncSession);

    but I have defined all the tables and also the Sync adapters properly...

    This is really important.

    Thanks in adavance
    Archan

    • Moved by Max Wang_1983 Thursday, April 21, 2011 11:25 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, September 10, 2009 6:01 AM

Answers

  • hi guys..

    Thanks for the reply.
    I am able to resolve the issue...

    The problem was in binding of the Adapters with the ServerSyncProvider.

    Thanks
    Archan
    Wednesday, September 16, 2009 12:46 PM

All replies

  • You should run sql profiler and determine what query is making sync fail.  Also, you should pull out the inner exception as it will more than likely be useful.

    Regard,


    Sean Kelley
    Senior Program Manager
    Microsoft
    Sunday, September 13, 2009 10:18 PM
    Moderator
  • Please check if client has got the schema from the server.

    If client has no schema when sync. it will try to get schema via SelectIncrementalInsertsCommand.  In this scenario @sync_client_id_binary IS NULL.
    Monday, September 14, 2009 11:31 PM
  • hi guys..

    Thanks for the reply.
    I am able to resolve the issue...

    The problem was in binding of the Adapters with the ServerSyncProvider.

    Thanks
    Archan
    Wednesday, September 16, 2009 12:46 PM