﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Close SQL Connections?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 13:46:33 GMT</lastBuildDate><ttl>20</ttl><item><title>Close SQL Connections?</title><link>http://forum.strataframe.net/FindPost29998.aspx</link><description>Is there a method I can call to close all the sql server connections.&lt;br/&gt;&lt;br/&gt;I'm trying to give the application a way for the user to disconnect from the server (close child&amp;nbsp;windows and&amp;nbsp;cisco vpn) and login again later (open vpn) without closing the main app.&amp;nbsp; All is working except for when I try to login for the second time.&amp;nbsp; I'm getting a SqlException: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error:0 - An existing connection was forcibly closed by the remote host).&amp;nbsp; Could this be caused by the sql connection not being close prior to the vpn shutting down?&amp;nbsp; Is there a way to close connections?&lt;br/&gt;&lt;br/&gt;Thanks!</description><pubDate>Wed, 25 May 2011 10:00:51 GMT</pubDate><dc:creator>Chris Diesel</dc:creator></item><item><title>RE: Close SQL Connections?</title><link>http://forum.strataframe.net/FindPost30020.aspx</link><description>Perfect.&amp;nbsp; Glad you&amp;nbsp; got it going.</description><pubDate>Wed, 25 May 2011 10:00:51 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Close SQL Connections?</title><link>http://forum.strataframe.net/FindPost30019.aspx</link><description>Thanks for the help.&amp;nbsp; What ended up working was the SqlConnection.ClearAllPools() just prior to disconnecting the VPN.</description><pubDate>Wed, 25 May 2011 08:59:19 GMT</pubDate><dc:creator>Chris Diesel</dc:creator></item><item><title>RE: Close SQL Connections?</title><link>http://forum.strataframe.net/FindPost30012.aspx</link><description>It depends on how you are managing your connections.&amp;nbsp; If you are using a BO, then the connection is never kept open longer than it takes to perform a query, update, etc.&amp;nbsp; When you are dealing with VPN environments, it is not uncommon for there to be a timeout that will close the connection (socket) to the server.&amp;nbsp; In this case, you may have to play with the VPN.&amp;nbsp; But here is what I would do to figure out where your issues are:&lt;br/&gt;&lt;br/&gt;&lt;ol&gt;&lt;li&gt;Create a test application&lt;/li&gt;&lt;li&gt;Manually create an SqlConnection&lt;/li&gt;&lt;li&gt;Manually create a similar SqlCommand that is causing an issue pre or post connection termination&lt;/li&gt;&lt;li&gt;Execute the query and leave the connection open and then repeat and close the connection to see if you can reproduce the problem&lt;/li&gt;&lt;/ol&gt;Putting this in a small scale test environment will help you isolate the issue and determine which end you need to be working on.</description><pubDate>Mon, 23 May 2011 08:28:38 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>