Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am confused. Using SQL Server compact, I add registers to a table in the programme (ok, in debug mode), and they appear perfectly in the data grid, etc. I close the page, or the application and on opening the app again, all is well. But if I close VS, the data disappears. The tables are empty.
What am I doing wrong, or what am I missing. It works perfectly well with SQL Server, but not the compact edition.
Thanks.
Posted

1 solution

Please note that the database will be deployed with the application as a resource file, thus by default it is handled as such. By default you should have “Copy to Output Directory” property on the database file Copy always. If so, you will always overwrite it. Now set this to Copy if newer.
See: http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/ad837d14-31ea-445f-b830-1a8682b69e68[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900