locked
Server-generated keys and server-generated values are not supported by SQL Server Compact RRS feed

  • Question

  • Hi all,

    On inserting a record like this:

                Poster_ratings prItem = new Poster_ratings
                {
                    poster_id = posterId,
                    rating = rating,
                    email = email,
                    name = name,
                    event_id = eventId,
                    id = GetNextID()
                };
              
                entity.AddToPoster_ratings(prItem);
                entity.SaveChanges();

    I get the error that server-generated values are not supported, I also tried without setting a value for 'id', gives same error ...

    I'm using Sql compact 3.5 (highest version supported by MS Sync Framework afaik?). The compact db is build up based on a sql server 2008, it syncs data with it, then I want to change (insert) something in the local db and this change should get synced to the 2008 server, but I'm stuck on the insert part in the local db :(

    I already set 'setStoreGeneratedPattern' to none for this table but this didn't help either, I keep getting the same error..What should I do to resolve this? I've read that Sql Ce 4.0 supports generating id's but this doesn't support change tracking etc.!

    Greets & Thanks in advance

    Btw: Mind you I should have several local db's running at the same moment, and occasionally syncing back their changes to the 2008 server, which in turn syncs back the other local db's,  I hope this is possible?

    Thursday, April 5, 2012 9:23 AM

Answers

All replies