My program has an online and offline mode.
- Online it connects to a SQL Server instance using the C# SqlCommandclasses.
- Offline it connects to a local .SDFfile using the C#SqlCeCommandclasses.
Now I want to do the following which works when in online mode
GetSqlCommand("insert into my_table (col1) values (@c1); SELECT SCOPE_IDENTITY()", conn))
So I insert a record a get back the ID of that new record with SELECT SCOPE_IDENTITY().
But when in offline mode using SQL Server CE, it throws an error. Is there a way to get back ID from the insert with SQL Server CE without running a separate query?
 
     
     
     
     
    