Dear sir,
I keep getting the following errors on one of my sites after clicking for
many times.
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.
Below is my code. Any help will be appreciated.
Dim objReader As SqlDataReader
Dim strConnection As String =
System.Configur ation.Configura tionSettings.Ap pSettings("strC onnect")
Dim myConnection As SqlConnection = New SqlConnection(s trConnection)
Dim myCommand As New SqlCommand("MyP roc_XXXX", myConnection)
myCommand.Comma ndType = CommandType.Sto redProcedure
Dim objPara1 As New SqlParameter("@ msgId", SqlDbType.Int, 4)
myCommand.Param eters.Add(objPa ra1)
objPara1.Direct ion = ParameterDirect ion.Input
objPara1.Value = MsgId
' Open the connection.
myConnection.Op en()
objReader = myCommand.Execu teReader()
MsgFull.DataSou rce = objReader
MsgFull.DataBin d()
objReader.Close ()
objReader = Nothing
myConnection.Cl ose()
myConnection = Nothing
--
Kind regards
Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com