Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 SQL User Instance - close open connection after at

Author  Topic 

RBC
Starting Member

17 Posts

Posted - 2011-12-27 : 12:47:34
Hi,

I am running a LightSwitch (LS) app; 1 table with 1 screen. I run the app and insert a record in my table, which works fine. After I close my app.

Then I attach the LS database to SQL Server Management Studio (SSMS) and insert a record by INSERT command.

After I run my LS app again and the database connection is not working; the LS do not display any data.

LS uses a User Instance to connect to the database (db), and LS can't do ANYTHING if it has an open connection to the db file.

How do I close all connections to my LS db after inserted a record with SSMS?

Is there a command I can run to see open connection and close all connections in SSMS?

I have tried to detach the database with and without drop connections and update statistics; without having success to have my LS app to run.

Thank you,

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-27 : 13:42:57
[code]USE master
GO
sp_who2[/code]This will show you all the SPIDs and the DB's they are connected to. If you are the only user who connected to the database using SSMS, if you change the database to master, or close the query window, or close SSMS altogether, it should release the connection. So I suspect that may not be your problem.

If you do want to kill all connections, there are couple of different scripts posted in this thread
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-12-27 : 13:51:32
Ok first you need to post the error message you are getting.

Also why are you attaching and detaching the database ?

PBUH

Go to Top of Page
   

- Advertisement -