Home >Backend Development >C++ >Why Do My Database Changes Disappear After Closing My SQL Server Compact Edition Application?
During debugging with SQL Server Compact Edition 4 and VS2012 Express, database modifications made via a console application might seem to vanish after closing the application. This often stems from using the |DataDirectory|
placeholder in your connection string.
Understanding the |DataDirectory|
Problem
|DataDirectory|
points to a temporary location within your project's bin
folder. The database used during debugging resides here and is deleted upon session termination. This explains why changes are visible in the debugger but disappear afterward. The Visual Studio Server Explorer, however, might show a seemingly unchanged database in your project's main folder.
Resolving the Issue
Here are several approaches to fix this:
bin
folder.bin
folder (to monitor changes).The above is the detailed content of Why Do My Database Changes Disappear After Closing My SQL Server Compact Edition Application?. For more information, please follow other related articles on the PHP Chinese website!