Poku
Poku

Reputation: 3188

Delete an sdf file in use?

Im trying to delete an sdf file in the .NET mobile framework, but I get a "File in use" Exception. How do I disable the file so I can delete it?

I want to replace the sdf file with a new sdf file.

Upvotes: 0

Views: 1643

Answers (1)

Scott Munro
Scott Munro

Reputation: 13596

SQL Server Compact Edition databases (sdf is the extension for database files) are hosted in process, you will need to close any connections and possibly stop any processes that had them open to delete this file.

Typical candidate processes that can cause this problem are the application itself, Visual Studio or SQL Server Management Studio.

Upvotes: 7

Related Questions