locked
No Data From Client RRS feed

  • Question

  •  

    I am using SQLExpress 2005 in a bidirectional sync for clients with a server.  The server writes changes to the client but the client is not writing changes back to the server.  Via SQL Server Profiler, I can see that the incremental stored procedures are running on both but by the time I get to GetChanges() there is no client data in the metadata dataset.  I can see that the client tables are added to the adapter. 

     

    I do not know if this is related but my timestamps convert to : 1900-01-01 00:00:10.237 and that seems odd. 

    What else can I investigate?

     

    Thanks,

    cj

     

     

    • Moved by Max Wang_1983 Friday, April 22, 2011 6:34 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, August 11, 2008 9:31 PM

All replies

  • can you profile the client db since this appears to be an isseu in selectChanges at the client db ? and then running the same query you get from the profiler to see what occurs ?

     

    also, please make sure the initial tracking value is not null as one has raised in this post http://forums.microsoft.com/sync/ShowPost.aspx?PostID=3719284&SiteID=75

     

    anyways, the profiler and retry the query agaist the db should give us enough info to nail down the cause.

    thanks

    Yunwen

    Tuesday, August 12, 2008 5:02 AM
    Moderator
  • Ok, I can see what is happening but I do not understand why it is happening.  What is happening is that the insert command for the remote server is adding an additional parameter and this causes the failure.  What I do not  understand is how this parameter is being added so I am not understand something.

     

    My sp_apply_insert accepts 6 parameters:

     

    Code Snippet

    CREATE PROCEDURE [dbo].[sp_qcustomer_applyinsert] (

    @customerid int = NULL ,

    @customeralias nvarchar(50) = NULL,

    @customerinactive bit = NULL,

    @sync_last_received_anchor binary(8) ,

    @sync_row_count int out,

    @sync_client_id_hash int )

    as

    INSERT INTO customer (customerid, customeralias, customerinactive, update_originator_id)

    VALUES (@customerid, @customeralias, @customerinactive, @sync_client_id_hash)

    SET @sync_row_count = @@rowcount

     

     

    My call to the server from the application is:

     

    Code Snippet

    // insert row com

    SqlCommand inscustomerCmd = new SqlCommand();

    inscustomerCmd.CommandType = CommandType.StoredProcedure;

    inscustomerCmd.CommandText = "sp_qcustomer_applyinsert";

    inscustomerCmd.Parameters.Add("@customerID", SqlDbType.Int);

    inscustomerCmd.Parameters.Add("@customeralias", SqlDbType.NVarChar, 50);

    inscustomerCmd.Parameters.Add("@customerInactive", SqlDbType.Bit);

    inscustomerCmd.Parameters.Add("@" + SyncSession.SyncClientIdHash, SqlDbType.Int);

    inscustomerCmd.Parameters.Add("@" + SyncSession.SyncLastReceivedAnchor, SqlDbType.Binary, 8);

    inscustomerCmd.Parameters.Add("@" + SyncSession.SyncRowCount, SqlDbType.Int).Direction = ParameterDirection.Output;

    adaptercustomer.InsertCommand = inscustomerCmd;

     

     

    But here is what I see when I run Profiler:

     

    Code Snippet

    declare @p6 int

    set @p6=NULL

    exec sp_qcustomer_applyinsert @customerID=4148,@customeralias=N'Red',

    @customerInactive=0,@sync_client_id_hash=306317948,

    @sync_last_received_anchor=0x000000000000B798,

    @sync_row_count=@p6 output

    @customerInactive=default

    select @p6

     

     

    Note the custonerInactive field is a bit field with a default value of zero and this appears to be what is added?  Am I not supposed to pass values with a default value?

     

    Thanks,

    cj

     

    Tuesday, August 12, 2008 5:01 PM