使用VB.NET的SQL连接 [英] SQL Connections with VB.NET

查看:89
本文介绍了使用VB.NET的SQL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如大多数人都知道的那样,当你关闭一个VB.NET连接到一个SQL

服务器时,连接实际上并没有在那里直接下降。

从我的测试中,使用VB.NET 2003和SQL2K,连接没有
超时并且下降6 1/2分钟。怎么能强迫这个

连接立即下载代码?

As most of you are aware, when you close a VB.NET connectrion to a SQL
server, the connection doesn''t actually drop right then and there.
From my tests, using VB.NET 2003 and SQL2K, the connection doesn''t
timeout and drop off for 6 1/2 minutes. How can one force this
connection to immediately drop off with code?

推荐答案

这叫做连接池。这是一件好事,你为什么要把它除掉呢?


" Joe Cool" <乔***** @ home.net>在消息中写道

news:qj ******************************** @ 4ax.com ...
This is called connection pooling. It is a good thing, why would you want to
get rid of it?

"Joe Cool" <jo*****@home.net> wrote in message
news:qj********************************@4ax.com...
正如大多数人都知道的那样,当你关闭一个VB.NET连接到一个SQL服务器时,连接实际上并没有正确地停在那里。从我的测试中,使用VB.NET 2003和SQL2K,连接没有超时并且下降了6 1/2分钟。如何强制这个
连接立即与代码一起下载?
As most of you are aware, when you close a VB.NET connectrion to a SQL
server, the connection doesn''t actually drop right then and there.
From my tests, using VB.NET 2003 and SQL2K, the connection doesn''t
timeout and drop off for 6 1/2 minutes. How can one force this
connection to immediately drop off with code?



我不相信.NET中有一种方法'用于清除ADO.NET 1.x中的连接的CLR(这将关闭实际的SQL Server连接);

我已经读过这应该是可以在2.0中使用,但我不知道这是否是

的情况。


是否有理由需要强制使用完整的SQL Server断开?

Joe Cool <乔***** @ home.net>在消息中写道

news:qj ******************************** @ 4ax.com ...
I don''t believe there is a way within .NET''s CLR to clear the connection
pool in ADO.NET 1.x (which would close the actual SQL Server connection);
I''ve read that this should be available in 2.0, but I don''t know if that is
the case.

Is there a reason you need to force the full SQL Server disconnect?
"Joe Cool" <jo*****@home.net> wrote in message
news:qj********************************@4ax.com...
正如大多数人都知道的那样,当你关闭一个VB.NET连接到一个SQL服务器时,连接实际上并没有正确地停在那里。从我的测试中,使用VB.NET 2003和SQL2K,连接没有超时并且下降了6 1/2分钟。如何强制这个
连接立即下载代码?
As most of you are aware, when you close a VB.NET connectrion to a SQL
server, the connection doesn''t actually drop right then and there.
From my tests, using VB.NET 2003 and SQL2K, the connection doesn''t
timeout and drop off for 6 1/2 minutes. How can one force this
connection to immediately drop off with code?



2005年6月1日星期三17:07:39 GMT,Joe酷< jo ***** @ home.net>写道:

$ b $b¤正如大多数人所知,当你关闭一个VB.NET连接到一个SQL
$ b $b¤服务器时,连接不会实际上就在那里掉落了。
$ b $b¤在我的测试中,使用VB.NET 2003和SQL2K,连接没有$ b $b¤超时并且下降为6 1 /2分钟。如何强制这个
$ b $b¤连接立即下载代码?


不确定您使用哪个提供程序或驱动程序与SQL Server但你可能禁用

连接池,虽然我不推荐它。

Paul

~~~~

Microsoft MVP(Visual Basic)
On Wed, 01 Jun 2005 17:07:39 GMT, Joe Cool <jo*****@home.net> wrote:

¤ As most of you are aware, when you close a VB.NET connectrion to a SQL
¤ server, the connection doesn''t actually drop right then and there.
¤ From my tests, using VB.NET 2003 and SQL2K, the connection doesn''t
¤ timeout and drop off for 6 1/2 minutes. How can one force this
¤ connection to immediately drop off with code?

Not sure which provider or driver you are using with SQL Server but you could probably disable
connection pooling, although I wouldn''t recommend it.
Paul
~~~~
Microsoft MVP (Visual Basic)


这篇关于使用VB.NET的SQL连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆