Question

I have a SQL Server CE Database file that gets re-deployed every time I run. This makes testing difficult.

The only way I have found that allows me to get around it is to open the database file on the device using Query Analyzer. My best guess is that this locks the file.

Opening the db (and putting in the password) takes some time (it will frequently disconnect due to my application).

I would love a quick any easy way to lock this file so I will not re-deploy every time I run from Visual Studio? (just when I want it to). Anyone have a good idea on how to do this on windows mobile?

Was it helpful?

Solution

Are you saying the database file itself is part of your project and it's Build Action is set to "Content"? If so, change the "Copy to Output Directory" property to "Do not Copy". You can then switch it on the occasions when you do want it deployed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top