G
Guoqi Zheng
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.Configuration.ConfigurationSettings.AppSettings("strConnect")
Dim myConnection As SqlConnection = New SqlConnection(strConnection)
Dim myCommand As New SqlCommand("MyProc_XXXX", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim objPara1 As New SqlParameter("@msgId", SqlDbType.Int, 4)
myCommand.Parameters.Add(objPara1)
objPara1.Direction = ParameterDirection.Input
objPara1.Value = MsgId
' Open the connection.
myConnection.Open()
objReader = myCommand.ExecuteReader()
MsgFull.DataSource = objReader
MsgFull.DataBind()
objReader.Close()
objReader = Nothing
myConnection.Close()
myConnection = Nothing
--
Kind regards
Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com
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.Configuration.ConfigurationSettings.AppSettings("strConnect")
Dim myConnection As SqlConnection = New SqlConnection(strConnection)
Dim myCommand As New SqlCommand("MyProc_XXXX", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim objPara1 As New SqlParameter("@msgId", SqlDbType.Int, 4)
myCommand.Parameters.Add(objPara1)
objPara1.Direction = ParameterDirection.Input
objPara1.Value = MsgId
' Open the connection.
myConnection.Open()
objReader = myCommand.ExecuteReader()
MsgFull.DataSource = objReader
MsgFull.DataBind()
objReader.Close()
objReader = Nothing
myConnection.Close()
myConnection = Nothing
--
Kind regards
Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com