Click here to Skip to main content
13,504,005 members
Rate this:
Please Sign up or sign in to vote.
I have a VS c# app using a local sqlexpress 2012 database. If I login to SQL Server Management Studio, then disconnect or logout, the app won't work until I restart the SQL Server(sqlexpress) Services. This same scenario also occurs if I access the database using sqlcmd. Apparently the whole database gets locked and doesn't release.

I am about to write a ServiceControl method to handle this problem by restarting the sqlexpress Service. And I don't like using sp_attach_db/sp_detach_db.

This communication problem with VS and sqlExpress can't be normal. Does anyone have a solution to this?

Is there a configuration in sqlexpress that I am missing where both applications can share nicely?


Posted 20-Dec-12 12:20pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I think the issue is that Management Studio does not disconnect and Express only supports one user. So you have to get it to log out, so someone else can log in. I am not sure how you do that.
RickiB 21-Dec-12 16:51pm
Christian, Thanks for your reply. You're right. Even if I disconnect in Management Studio, it still doesn't log out even after closing Management Studio; I still need to restart the SQL Server Services before starting the VS app. And I couldn't find a log out or disconnect in sqlcmd either without sp_detach_db which causes additional problems.
Thanks again,

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180417.1 | Last Updated 20 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100