Friday, March 23, 2012

Forcing DB Changes to commit in SQL CE !!!

This is a really wide spread - more than a time discussed - on SQL CE MSDN Forums - Issue !!!

Is there any way i can commit changes which happens during runtime (when i am developing the application) such as inserts/updates and deletes to the .sdf DB on the machine ?

You have several options to change this behavior. If your sdf file is part of the content of your project, this will affect how data is persisted. Remember that when you debug, all output of your project (including the sdf) if in the bin/debug folder.

- You can decide not to include the sdf file as part of your project and manage the file location runtime.

- If you are using "copy if newer", and project changes you make to the database will overwrite any runtime/debug changes.

- If you are using "Do not copy", you will have to specify the location in code (as two levels above where your program is running).

- If you have "Copy always", any changes made during runtime will always be overwritten

Hope this assists.

No comments:

Post a Comment