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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top