Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Answered SQL Mobile application data sync between mobile file and sql server

  • Saturday, January 28, 2012 5:47 PM
     
     

    Hi!

    I have followed an example from microsoft site: http://msdn.microsoft.com/en-us/library/ff621674.aspx

    But stuck with SqlCeReplication Synchronize() method, the error I got was:

    Error Code: 80045003
    Message: The initial snapshot for publication 'VendorMobile' is not yet available. Start the Snapshot agent to generate the snapshot for this publication.
    If this snapshot is currently being generated, wait for the process to complete and restart the synchronization.

    ---------------------------------------------------------------------------------------------------------------------------------------

    I cannot figure out where should the "SubscriberConnectionString" file (.sdf) file being created?

    I have seen some examples using:

    1. Path.ChangeExtension(Assembly.GetExecutingAssembly().GetName().CodeBase, "sdf");

    2. SubscriberConnectionString="\advMobile.sdf";

    but I don't see the .sdf being created anywhere?  are they relatvie path on the device that I couldn't find on my local drive?

    Could anyone give me some help on where should the .sdf file being set and the Snapshot agent could access to sync data?

    Thanks in advanced!!!

     

     

     

All Replies

  • Monday, January 30, 2012 2:54 AM
     
     Answered

    I had the problem solved!!!

    I keep the .sdf as the example (@ Path.ChangeExtension(Assembly.GetExecutingAssembly().GetName().CodeBase, "sdf");)

    Then, I started to look into the" The initial snapshot for publication 'VendorMobile' is not yet available." Error.

    My SQL Agent could not even start properly. I look into the hisotry log (error log), the error was:  Sql Server Agent job failed:
    Unable to determine if the owner ([Mydomain]\[user]) of job [MyServerName]-AdventureWorks-VendorMobile-4 has server access (reason: Could not obtain information about Windows NT group/user '[Mydomain]\[user]', error code 0x54b. [SQLSTATE 42000] (Error 15404)  The statement has been terminated. [SQLSTATE 01000] (Error 3621)).
    => The reason is because the db owner of "AdventureWorks" and "SQLMobile" are [Mydomain]\[user].  (by executing: select name, suser_sname(owner_sid) from sys.databases  could see clearly.)

    => Solution: executing procedure: EXEC sp_changedbowner 'sa' for database: AdventureWorks and SQLMobile.
    => The SQL Server Agent started successfully and Snapshot Agent generated 1 article.

    And I went back to try the sample, I was able to modified and add new record.



  • Tuesday, January 31, 2012 8:02 AM
    Moderator
     
     

    Thanks for sharing the solution.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us