Do you have an idea what might cause the error in the title? It highlights an error in the following part of the code:
SyncAdapter notesSyncAdapter = notesBuilder.ToSyncAdapter();
((SqlParameter)notesSyncAdapter.SelectIncrementalInsertsCommand["@sync_last_received_anchor"]).DbType = System.Data.DbType.Binary;
((SqlParameter)notesSyncAdapter.SelectIncrementalInsertsCommand.Parameters["@sync_new_received_anchor"]).DbType = System.Data.DbType.Binary;