|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sql server express 2005 connections openI 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.) Hi Kevin
Thanks for the info, spot on as usual Regards Steve Show quoteHide quote "Kevin Yu [MSFT]" <v-k***@online.microsoft.com> wrote in message news:0FLLAmQ7GHA.2336@TK2MSFTNGXA01.phx.gbl... > 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.) > 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.) Kevin Yu [MSFT] wrote:
> The connections will be closed completely if you close your app. You Additionally, if you're using VB2005, you can call the > can also disable pooling by adding "pooling=false" in your connection > string. SqlClient.SqlConnection.ClearAllPools() method to clear the connection pool on demand. -- (O)enone
Compiling for .NET Framework 1.x in VS 2005
How to open a .CSV file ? Moving Forms Search for Directories/files/Folders When "As New" or not when instantiating? DataTable - Date Difference "using statments" slightly OT: VB user base Is there any way to Mount Virtual CD's from VB? VB.net app to run in the background |
|||||||||||||||||||||||