Mike Wachal - MSFT
You are connecting to a User Instance which is a special type of SQL instance designed for use with single user, local data applications. User Instances are not designed for use with deployed ASP.NET applications. The fact that the VS development tools use this type of connection is not really the fault of SQL Express.
You're actually seeing the combination of two by design behaviors of SQL Express:
- All database created in SQL Express have Auto_Close set to True, so the database is closed when there are no connections remaing to the database. When a connection is made, the database is re-opened in an asynchronous operation that is fairly quick and doesn't cause that much of a perf hit. The database is not detached as you've suggested, it is simply closed. Closing the database saves machine resources and typically doesn't impact most single user, Windows applciations.
- User Instances are automatically shut down after 60 minutes. Again, this is designed for use as a local data store for windows applications. After you close an application, the User Instance timesout and is shut down. The next time you open the application it will restart the User Instance and connect to the database. This does take some time, but is usually lost in the time taken to start the application itself.
The answer for you is to not use User Instances for your deployed application. You'll need to attach the database directly to the parent instance where ever you are serving your database from and then change your connection string by removing the 'User Instance' keyword and removing the AttachDbFilename keyword and replace it with the name of the database attached to the main server. You may also want to change the Auto_Close setting on the database to ensure it doesn't close, but this behavior may or may not cause you an issue.
The management tools for SQL Express are fully functional and you can use them to configure what ever you want. If you are find the tools as read only, it's is related to your configuration, not because the tools are designed that way. Likely you don't have permissions to make the changes you're attempting. You can get more help with Management Studio Express by posting question directly into the General Tools forum.
Mike