P
Proc
My application makes extensive use of the SQLHelper class provided
with the Microsoft DAAB. The problem I am having is when I have a
bunch of users use my application, I get the following exception
periodically:
---------------------------
System.Data.SqlClient.SqlException: Timeout expired. The timeout
period elapsed prior to completion of the operation or the server is
not responding.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection
(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Web.SessionState.SqlStateConnection..ctor(String
sqlconnectionstring)
---------------------------
Now, I know the problem has to do with connection pooling, but I am
not sure how to resolve it. Here is a sample of my code (some details
have been removed to illustrate the important parts):
---------------------------
strSQL = "SELECT STATEMENT HERE"
objDR = SqlHelper.ExecuteReader(strConnString, CommandType.Text,
strSQL)
If (objDR.Read) Then
'Do Something
End If
objDR.Close()
---------------------------
I believe that I simply have to "dispose" of the connection opened by
SqlHelper, but I have no idea how to get to it. Am I doing something
wrong? Is there any way to fix this without explicitly creating my
own Connection object and passing it into the ExecuteReader?
Thanks for any information you can provide.
with the Microsoft DAAB. The problem I am having is when I have a
bunch of users use my application, I get the following exception
periodically:
---------------------------
System.Data.SqlClient.SqlException: Timeout expired. The timeout
period elapsed prior to completion of the operation or the server is
not responding.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection
(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Web.SessionState.SqlStateConnection..ctor(String
sqlconnectionstring)
---------------------------
Now, I know the problem has to do with connection pooling, but I am
not sure how to resolve it. Here is a sample of my code (some details
have been removed to illustrate the important parts):
---------------------------
strSQL = "SELECT STATEMENT HERE"
objDR = SqlHelper.ExecuteReader(strConnString, CommandType.Text,
strSQL)
If (objDR.Read) Then
'Do Something
End If
objDR.Close()
---------------------------
I believe that I simply have to "dispose" of the connection opened by
SqlHelper, but I have no idea how to get to it. Am I doing something
wrong? Is there any way to fix this without explicitly creating my
own Connection object and passing it into the ExecuteReader?
Thanks for any information you can provide.