well, you never actually associate the new act with any gig - is that what is missing?


or maybe:

dbact.gig = dbgig;

or something with the ids.

i.e. are you sure the act in the db is for the gig?


i had a similar issue, the problem / solution in my case was that the internal class that represented the database table was missing part of the primary key.

this appeared to work ok until the data from the db caused a primary key constraint in the code that the database was happy with.



an alternative to gfrizzle's answer is unless you have a compelling reason to do so don't call submitchanges until after you have done all the db work.


try opening a fresh dbcontext at the beginning of this block. if you're using the same context for the first and second run, it won't see the inserted record the second time around. resetting the context should force it to see the latest rows in the table.

Related Query

More Query from same tag