I'm coding a project in C#, VS2010, using SQL Express 2008 as the data source. Whenever any other application connects to the database (such as Management Studio), the next time my C# application runs, it cannot access the database.
The error is "Operating system error 32".
Unable to open the physical file "... .mdf".
The process cannot access the file because it is being used by another process.
Cannot open user default database. Login failed.
It doesn't matter what other application touches the database, my app will fail unless and until I restart the SQL Server service.
I use SSMS, and I also have created a DSN to the database for a third party application to query and update. When either of these run (and they do, with no errors), then I have to restart the SQL Server service before I run my C# app.
I'd obviously like to understand why this is so and fix it!