Sql server express 2005 connections open

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

Hi All

I have a VB.net 2005 application which uses Sql server express 2005

When I read or write data to sql server I always close the connection immediately after finishing using...
---------------------------------------------------
If Not IsNothing(con) Then

con.Dispose()

con = Nothing

End If

-----------------------------------------------------

When I go into Sql server management studio to detach the database etc there is usually always at least 2 open connections showing in the studio

Close cursor on commit = false

autoclose = false

What am I missing??

Regards

Steve
 
Hi Steve,

This might be caused by connection pooling. If pooling is enabled, when you
call close() on a connection, the connection to the database is actually
not closed. It was just returned to the pool. This is used to improve
performance if your app is frequently opening and closing connections.

The connections will be closed completely if you close your app. You can
also disable pooling by adding "pooling=false" in your connection string.

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Kevin said:
The connections will be closed completely if you close your app. You
can also disable pooling by adding "pooling=false" in your connection
string.

Additionally, if you're using VB2005, you can call the
SqlClient.SqlConnection.ClearAllPools() method to clear the connection pool
on demand.
 
Hi Steve,

If the connection pooling info does not resolved your issue, please feel
free to let me know.

Kevin Yu
Microsoft Online Community Support
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top