I'm doing an insert into a SQL Server CE table where the primary key is auto-generated, how would I go about getting the primary key after the insertion completes?
Assuming your primary key is an identity field, you can use the query SELECT @@IDENTITY
after you insert your new row.