vb.net中的错误最大池 [英] error max pool in vb.net
本文介绍了vb.net中的错误最大池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我在vb.net中创建了一个简单的工具,该工具将从一个数据库读取所有数据到另一个数据库
数据库
我在2到3分钟之间出现错误
超时时间已到.从池中获取连接之前已经经过了超时时间.发生这种情况的原因可能是所有池化连接都在使用中,并且达到了最大池大小.
即使出现此错误,我也可以正确打开和关闭连接
这是我的代码在这里
hi all, i have created simple tool in vb.net, that tool will read all data''s from one database to another
database
i am getting error between 2 to 3 min that
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
i am opening and closing my connection properly even i am getting this error
this is my code here
con1.open()
Dim cmd As New SqlCommand(StrSql, con1)
cmd.Connection = con1
OpenRs1 = cmd.ExecuteReader()
con1.close
推荐答案
超时也可能表示某个查询执行时间过长.如果您不为连接提供超时,则默认值将设置为30秒.如果查询(或命令)花费的时间超过30秒,则会收到超时异常.尝试将连接上的timeout属性设置为更大的超时.
希望这会有所帮助,
爱德华
The timeout may also indicate that a certain query takes too long to execute. If you don''t provide a timeout to the connection, the default will be set to 30 seconds. If a query (or command) takes longer than 30 seconds, you''ll receive a timeout exception. Try setting the timeout property on the connection to a larger timeout.
Hope this helps,
Eduard
这篇关于vb.net中的错误最大池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文