Still Connected to DB after calling Close()?

  • Thread starter Thread starter wackyphill
  • Start date Start date
W

wackyphill

When connecting to a SQL Server DB I Open the connection and close it
after doing what needed to be done and it stays Closed until I need it
again.

But..I've noticed that I can't drop the database until my program exits
even though I know the Connection had been closed.

So is SqlConneection.Close() not a real Close?
 
When connecting to a SQL Server DB I Open the connection and close it
after doing what needed to be done and it stays Closed until I need it
again.

But..I've noticed that I can't drop the database until my program exits
even though I know the Connection had been closed.

So is SqlConneection.Close() not a real Close?

You've got connection pooling happening. You might need to disable it.

Michael
 
OK, so what's the point of Closing your connections if they stay open?

Why not just leave it open? I thought Pooling made reconnects faster
but gave the DB server a rest by not staying connected?

Seems like its always connected though.
 
Back
Top