By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 799 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

SQLConnection.Open() Timeout Error - but...nothing has changed?

P: n/a
I've been working on an asp.net application and everything's been great.
But suddenly, whether I'm tyring to use a database on my own machine, or on
my server, I'm getting a timeout when trying to open a database connection.
The error seems to happen regardless of what ASP.NET app I'm working
with/trying to debug.
It will open a few connections,

Here's the error:
Server Error in '/MyApplication' Application.
--------------------------------------------------------------------------------

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.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.

Source Error:

Line 156:
Line 157: // Open the database connection and execute the command
Line 158: myConnection.Open();
Line 159: SqlDataReader result =
myCommand.ExecuteReader(CommandBehavior.CloseConne ction);
Line 160:

Source File:
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs Line:
158

Stack Trace:

[InvalidOperationException: 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.]
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +396
System.Data.SqlClient.SqlConnection.Open() +384
ASPNetPortal.PortalSettings..ctor(Int32 tabIndex, Int32 tabId) in
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs:158
ASPNetPortal.Global.Application_BeginRequest(Objec t sender, EventArgs e)
in F:\dev\CeltTech\EquityCheck\EquityCheck\Global.asa x.cs:47
System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

The connection string I use in my web.config is:

<add key="ConnectionString"
value="server=manwe;Trusted_Connection=false;datab ase=MyDatabase;Application
Name=MyApplication;User ID=sqluser; Password=sqlpassword;"/>

Help?
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Are you closing your connections after you've
finished retrieving or writing data with them ?

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Nevyn Twyll" <as****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I've been working on an asp.net application and everything's been great.
But suddenly, whether I'm tyring to use a database on my own machine, or
on my server, I'm getting a timeout when trying to open a database
connection.
The error seems to happen regardless of what ASP.NET app I'm working
with/trying to debug.
It will open a few connections,

Here's the error:
Server Error in '/MyApplication' Application.
--------------------------------------------------------------------------------

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.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.

Source Error:

Line 156:
Line 157: // Open the database connection and execute the
command
Line 158: myConnection.Open();
Line 159: SqlDataReader result =
myCommand.ExecuteReader(CommandBehavior.CloseConne ction);
Line 160:

Source File:
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs
Line: 158

Stack Trace:

[InvalidOperationException: 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.]

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +396
System.Data.SqlClient.SqlConnection.Open() +384
ASPNetPortal.PortalSettings..ctor(Int32 tabIndex, Int32 tabId) in
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs:158
ASPNetPortal.Global.Application_BeginRequest(Objec t sender, EventArgs e)
in F:\dev\CeltTech\EquityCheck\EquityCheck\Global.asa x.cs:47

System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032

The connection string I use in my web.config is:

<add key="ConnectionString"
value="server=manwe;Trusted_Connection=false;datab ase=MyDatabase;Application
Name=MyApplication;User ID=sqluser; Password=sqlpassword;"/>

Help?

Nov 19 '05 #2

P: n/a
Yes - I just went through and made sure that was happening, and that my
datareaders were ComandBehavior.CloseConnection.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Are you closing your connections after you've
finished retrieving or writing data with them ?

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Nevyn Twyll" <as****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I've been working on an asp.net application and everything's been great.
But suddenly, whether I'm tyring to use a database on my own machine, or
on my server, I'm getting a timeout when trying to open a database
connection.
The error seems to happen regardless of what ASP.NET app I'm working
with/trying to debug.
It will open a few connections,

Here's the error:
Server Error in '/MyApplication' Application.
--------------------------------------------------------------------------------

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.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.

Source Error:

Line 156:
Line 157: // Open the database connection and execute the
command
Line 158: myConnection.Open();
Line 159: SqlDataReader result =
myCommand.ExecuteReader(CommandBehavior.CloseConne ction);
Line 160:

Source File:
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs Line:
158

Stack Trace:

[InvalidOperationException: 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.]

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +396
System.Data.SqlClient.SqlConnection.Open() +384
ASPNetPortal.PortalSettings..ctor(Int32 tabIndex, Int32 tabId) in
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs:158
ASPNetPortal.Global.Application_BeginRequest(Objec t sender, EventArgs
e) in F:\dev\CeltTech\EquityCheck\EquityCheck\Global.asa x.cs:47

System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032

The connection string I use in my web.config is:

<add key="ConnectionString"
value="server=manwe;Trusted_Connection=false;datab ase=MyDatabase;Application
Name=MyApplication;User ID=sqluser; Password=sqlpassword;"/>

Help?


Nov 19 '05 #3

P: n/a
And the weird thing is, if I deploy the application to an IIS server, and
run it there, it seems fine....
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Are you closing your connections after you've
finished retrieving or writing data with them ?

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Nevyn Twyll" <as****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I've been working on an asp.net application and everything's been great.
But suddenly, whether I'm tyring to use a database on my own machine, or
on my server, I'm getting a timeout when trying to open a database
connection.
The error seems to happen regardless of what ASP.NET app I'm working
with/trying to debug.
It will open a few connections,

Here's the error:
Server Error in '/MyApplication' Application.
--------------------------------------------------------------------------------

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.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.

Source Error:

Line 156:
Line 157: // Open the database connection and execute the
command
Line 158: myConnection.Open();
Line 159: SqlDataReader result =
myCommand.ExecuteReader(CommandBehavior.CloseConne ction);
Line 160:

Source File:
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs Line:
158

Stack Trace:

[InvalidOperationException: 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.]

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +396
System.Data.SqlClient.SqlConnection.Open() +384
ASPNetPortal.PortalSettings..ctor(Int32 tabIndex, Int32 tabId) in
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs:158
ASPNetPortal.Global.Application_BeginRequest(Objec t sender, EventArgs
e) in F:\dev\CeltTech\EquityCheck\EquityCheck\Global.asa x.cs:47

System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032

The connection string I use in my web.config is:

<add key="ConnectionString"
value="server=manwe;Trusted_Connection=false;datab ase=MyDatabase;Application
Name=MyApplication;User ID=sqluser; Password=sqlpassword;"/>

Help?


Nov 19 '05 #4

P: n/a
Are you using XP as a Dev box ?

I think there's an issue with the max number
of connections available through XP.

Same for MSDE...

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Nevyn Twyll" <as****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
And the weird thing is, if I deploy the application to an IIS server, and
run it there, it seems fine....
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Are you closing your connections after you've
finished retrieving or writing data with them ?

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Nevyn Twyll" <as****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I've been working on an asp.net application and everything's been great.
But suddenly, whether I'm tyring to use a database on my own machine, or
on my server, I'm getting a timeout when trying to open a database
connection.
The error seems to happen regardless of what ASP.NET app I'm working
with/trying to debug.
It will open a few connections,

Here's the error:
Server Error in '/MyApplication' Application.
--------------------------------------------------------------------------------

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.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.

Source Error:

Line 156:
Line 157: // Open the database connection and execute the
command
Line 158: myConnection.Open();
Line 159: SqlDataReader result =
myCommand.ExecuteReader(CommandBehavior.CloseConne ction);
Line 160:

Source File:
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs
Line: 158

Stack Trace:

[InvalidOperationException: 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.]

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +396
System.Data.SqlClient.SqlConnection.Open() +384
ASPNetPortal.PortalSettings..ctor(Int32 tabIndex, Int32 tabId) in
f:\dev\celttech\equitycheck\equitycheck\components \configuration.cs:158
ASPNetPortal.Global.Application_BeginRequest(Objec t sender, EventArgs
e) in F:\dev\CeltTech\EquityCheck\EquityCheck\Global.asa x.cs:47

System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032

The connection string I use in my web.config is:

<add key="ConnectionString"
value="server=manwe;Trusted_Connection=false;datab ase=MyDatabase;Application
Name=MyApplication;User ID=sqluser; Password=sqlpassword;"/>

Help?



Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.