Showing posts with label expired. Show all posts
Showing posts with label expired. Show all posts

Sunday, February 12, 2012

Connection problems

Basically I am getting this message every now and again: "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." But the weirdest thing is I am closing all my connections, and using a single connection string to my SQL Server database. Here is a typical function to prove this:

Public Shared Function GetTheMenu() As SqlDataReader


Dim connection As New SqlConnection(dbconnection.connString)
Dim command As New SqlCommand("SP_GetTheMenu", connection)


command.CommandType = CommandType.StoredProcedure
connection.Open()


Return command.ExecuteReader(CommandBehavior.CloseConnection)


End Function

When I go into SQL i just see loads of open connections to the database with references to the stored procedure that has been executed - surely this should not be the case if the stored procedure is a simple Select statement that is pases a value to to a datareader, and is (supposedly) automatically closed?

Can anyone suggest reasons why this is happening?

Thanks.

I have seen this error before. Have you tried calling Close() manually on the connection object?

Andy.Smile

|||Yes and it makes no differenceTongue Tied|||Also make sure to close all DataReaders after finishing using them. You can also try Dispose() connections after using them.|||Is there anything I can do at the database level to make sure the connection closes?|||

You can check the master..sysprocesses to find out current connections on the SQL Server. Please take a look at this post:

http://forums.asp.net/thread/1400183.aspx

Friday, February 10, 2012

Connection problem when registering a remote SQL2000

Hello,
I try to register a remote SQL Server 2000 installed in a W2003, but it
doesn't work. Afer 6 or 7 seconds, it says: Timeout expired.
In that network , port 1433 is open and what it really surpises me, is that
I can connect via ODBC to any database of that remote SQL Server2000 !!!
Any idea ?
If you can you use Enterprise Manager from the W2003 server, please check
the following:
Launch the Properties dialog from the server object of Enterprise Manager
Select the Network Configuration button on the General tab
Is TCP/IP enabled?
Select the Connections tab
Is the Query time-out value set too low?
Is the maximum concurrent user connections value set too low?
This posting is provided "AS IS" without express or implied warranty,
guarantee, or rights.
Keith Wilson
"Charles" <ccolell@.softeng.es> wrote in message
news:eGpQpjJHEHA.3576@.tk2msftngp13.phx.gbl...
> Hello,
> I try to register a remote SQL Server 2000 installed in a W2003, but it
> doesn't work. Afer 6 or 7 seconds, it says: Timeout expired.
> In that network , port 1433 is open and what it really surpises me, is
that
> I can connect via ODBC to any database of that remote SQL Server2000 !!!
> Any idea ?
>
|||Hello,
Yes , everything is ok. TCP/IP is enabled, and the rest values, the query
time is 600 (the default value), and the maximum users is (0, the default
value which means that are unlimited).
Any other idea ?
"Keith Wilson" <keithwi@.online.microsoft.com> escribi en el mensaje
news:4074336d$1@.news.microsoft.com...
> If you can you use Enterprise Manager from the W2003 server, please check
> the following:
> Launch the Properties dialog from the server object of Enterprise
Manager
> Select the Network Configuration button on the General tab
> Is TCP/IP enabled?
> Select the Connections tab
> Is the Query time-out value set too low?
> Is the maximum concurrent user connections value set too low?
>
> This posting is provided "AS IS" without express or implied warranty,
> guarantee, or rights.
> Keith Wilson
>
> "Charles" <ccolell@.softeng.es> wrote in message
> news:eGpQpjJHEHA.3576@.tk2msftngp13.phx.gbl...
> that
>

Connection problem when registering a remote SQL2000

Hello,
I try to register a remote SQL Server 2000 installed in a W2003, but it
doesn't work. Afer 6 or 7 seconds, it says: Timeout expired.
In that network , port 1433 is open and what it really surpises me, is that
I can connect via ODBC to any database of that remote SQL Server2000 !!!
Any idea ?If you can you use Enterprise Manager from the W2003 server, please check
the following:
Launch the Properties dialog from the server object of Enterprise Manager
Select the Network Configuration button on the General tab
Is TCP/IP enabled?
Select the Connections tab
Is the Query time-out value set too low?
Is the maximum concurrent user connections value set too low?
This posting is provided "AS IS" without express or implied warranty,
guarantee, or rights.
Keith Wilson
"Charles" <ccolell@.softeng.es> wrote in message
news:eGpQpjJHEHA.3576@.tk2msftngp13.phx.gbl...
> Hello,
> I try to register a remote SQL Server 2000 installed in a W2003, but it
> doesn't work. Afer 6 or 7 seconds, it says: Timeout expired.
> In that network , port 1433 is open and what it really surpises me, is
that
> I can connect via ODBC to any database of that remote SQL Server2000 !!!
> Any idea ?
>|||Hello,
Yes , everything is ok. TCP/IP is enabled, and the rest values, the query
time is 600 (the default value), and the maximum users is (0, the default
value which means that are unlimited).
Any other idea ?
"Keith Wilson" <keithwi@.online.microsoft.com> escribi en el mensaje
news:4074336d$1@.news.microsoft.com...
> If you can you use Enterprise Manager from the W2003 server, please check
> the following:
> Launch the Properties dialog from the server object of Enterprise
Manager
> Select the Network Configuration button on the General tab
> Is TCP/IP enabled?
> Select the Connections tab
> Is the Query time-out value set too low?
> Is the maximum concurrent user connections value set too low?
>
> This posting is provided "AS IS" without express or implied warranty,
> guarantee, or rights.
> Keith Wilson
>
> "Charles" <ccolell@.softeng.es> wrote in message
> news:eGpQpjJHEHA.3576@.tk2msftngp13.phx.gbl...
> that
>