none
Sync SQL and SQLCE ____ - DBNull value can not be represented as a built-in .NET system type. Use SqlTypes or IsDBNull property RRS feed

  • Question

  • Hi,

    I want to sync SQL server 2008 and SQL CE 3.5, I defined for SQL server : SqlSyncProvider, SqlSyncScopeProvisioning, DbSyncScopeDescription, add the tables to the scope, then execute those instruction :

    serverConfig.PopulateFromScopeDescription(scopeDesc);
    serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip);
    serverConfig.Apply((System.Data.SqlClient.SqlConnection)provider.Connection);

    the same thing for SQL ce : SqlCeSyncProvider, SqlCeSyncScopeProvisioning, DbSyncScopeDescription, add the table and execute the same commands.

    Both SQL server and SQLce contain data.

    when calling Synchronize from the orchestrator, it fire and exception :DBNull value can not be represented as a built-in .NET system type. Use SqlTypes or IsDBNull property.

    I spent a lot of time analysing the code, but without any solution!!

    any suggestions?

     

    Wednesday, July 7, 2010 9:53 AM

All replies

  • Yes, but it doesn't help :)...

     

    I don't know if there is no solution for this kind of issue in this moment !

    Wednesday, July 7, 2010 11:48 AM
  • how about setting SetPopulateTrackingTableDefault
    Wednesday, July 7, 2010 12:15 PM
    Moderator
  • I didn't defined any values for thoses options : SetCreateProceduresForAdditionalScopeDefault, SetCreateTrackingTableDefault, SetCreateTriggersDefault, SetCreateProceduresDefault

    There is issue coming from there !?

    One an other observation : if I make a sync for a single table, the sync works, but it delete all client (sqlce) data and replace them with server data (sql server) ... I don't want to delete the client data, I want to keep them and add the server data !..

    Wednesday, July 7, 2010 12:34 PM
  • The SetPopulateTrackingTableDefault setting allows you explicitly specify that the tracking tables be populated with metadata for existing rows.

    as for the Server rows overwriting your client data, you may want to specify how you want to handle conflicts in the ApplyChangeFailed event.

    Wednesday, July 7, 2010 1:08 PM
    Moderator