0

I have an windows desktop application which uses Mssql2005 express database.

But sometimes, my application cannot connect with the database. When I run "exec sp_helpdb", my database name is not included in the result list. And when I try to attach my database, server says "database name already exist".

What happened with my database, please help me on this issue!

My application built on .NetFrameWork3.5

Kind Regards

Orgil
  • 187
  • 3
  • 13

1 Answers1

0

Are you open a connection to the database in your application and you are not closing it?

Try to check the number of your connection with this script, before you are running your app, in the middle and after it got stuck-

SELECT 
    DB_NAME(dbid) as DBName, 
    COUNT(dbid) as NumberOfConnections,
    loginame as LoginName
FROM
    sys.sysprocesses
WHERE 
    dbid > 0
GROUP BY 
    dbid, loginame

source

Community
  • 1
  • 1
The scion
  • 1,001
  • 9
  • 19