System.InvalidCastException generated when initializing local provider RRS feed

  • Question

  • I have a sync application going with VS 2008, MS SQL 2008 and SQLCE. I used the wizard to setup the sync tables and all that worked great. The first time I did the sync, no problems, ran great. I closed down the application, and started it back up, and now get System.InvalidCastException when it  executes the following line of code:
    this.LocalProvider = new AppLocalSyncClientSyncProvider();
    public AppLocalSyncClientSyncProvider() {
        this.ConnectionString = global::App.Properties.Settings.Default.ClientConnectionString;
    I have no clue why this might be happening. I try to step through the code, but the constructor for that class only sets up the connection string. Is there somewhere else to look for this? Also, why would I get an invalid cast when the client databas was created from the server side database? I'm not understanding all of this.

    • Moved by Hengzhe Li Friday, April 22, 2011 3:06 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, June 8, 2009 4:42 PM


  • May you share more code of your app? Also, what's the type of your LocalProvider?

    This posting is provided AS IS with no warranties, and confers no rights.
    Wednesday, June 10, 2009 1:11 AM