views:

113

answers:

3

It appears here:

            SyncAdapter notesSyncAdapter = notesBuilder.ToSyncAdapter();
        ((SqlParameter)notesSyncAdapter.SelectIncrementalInsertsCommand.Parameters["@sync_last_received_anchor"]).DbType = System.Data.DbType.Binary;
        ((SqlParameter)notesSyncAdapter.SelectIncrementalInsertsCommand.Parameters["@sync_new_received_anchor"]).DbType = System.Data.DbType.Binary;

The user has has all permissions on both the table, schema and the database. Any idea what might this still throw this exception?

more details: SQLiteConnectionStringBuilder builder = new SQLiteConnectionStringBuilder();

builder["Data source"] = "achernar"; builder["User ID"] = "sbbf974"; builder["Password"] = "whatever"; builder["Integrated Security"] = false; builder["Initial Catalog"] = "sticky";

A: 

Are you absolutely positive that your code and database are synced up correctly? If you can i'd recommend having one of your coworkers check the following. Sometimes a fresh set of eyes can catch something you've been overlooking...

  • Are you referring to the correct DB in your code (as opposed to a development DB)
  • Are you connecting as the user you think in your code
  • Does that user have permissions in the DB you are connecting to

I know it probably sounds obvious but I'd say it's worth having someone else double check for you. I know I've been caught by this before...

Abe Miessler
yes. I've tested the credentials/settings by using the wizard that pops when adding a new LocalDataCacheItem.
bsuv
A: 

Who is the 'user' ? I much rather trust SQL Server that clearly states that current connection does not have permission. The sync framework goes through several layers, via IIS and ISAPI until it reaches the database, so you better figure out exactly what credentials are used. Is there impersonation at IIS layer occurring? Constrained Delegation? Does the sync framework client authenticate with IIS using what (NTLM/Digest/Basic/Nothing) ?

Remus Rusanu
A: 

The issue was with the user, as Abe guessed. The user was dbo, meaning that although it should have had all the permissions, it didn't. So what I've done was to create another login, to which I gave the following database roles: public, db_datareader, db_datawriter. It works now.

bsuv
Please accept your own answer once it becomes available, so that this question is marked as resolved. Glad you found a solution - I've never heard of the DBO user not having rights to do everything.
rwmnau