set Timeout for sqlconnection
sqlconnection conn = new sqlconnection();
conn.ConnectionTimeout = 1000;
The time (in seconds) to wait for a connection to open. The default value
is 15 seconds.
Main Topics
Browse All TopicsHi,
I have an asp.net web app using the sql server 2005.
From the VS 2005, I didn't have any problems.
Today, I deployed the web app to the webserver (SQL Server 2005 is on another server).
I logined to theweb app ok and were able to browse different pages OK for a while.
After that I get this timeout error.
I used a lot of SQLdatasource. I thought it automatically close the sql connection.
Also why didn't I have the same problem from the VS2005??
Thanks
The timeout period elapsed prior to obtaining a connection from the pool.Question:
I am getting this error message:
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.
Stack Trace:
[InvalidOperationException
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
cyberdoc.Worker.LoginComma
cyberdoc.Worker.Login(Obje
cyberdoc.LoginForm.bLogin_
System.Web.UI.WebControls.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
1) List the connection string (you may disclose your servernames) and port specification
<add name="xxx" connectionstring="Data Source=myservername;Initia
2) What user is connecting to the database? SQL User I created.
3) "I used a lot of datasource" - what do you mean? Do you use a system dsn?
I meant I created SqlDataSources in the aspx page.
When I manually created in the behind code page, I made sure I closed all the SQL connections.
4) What does your sql server say? See in the server log - do you get any access denied messages?
Nothing on the log.
It's odd that everything runs smooth from Visual Studio.
I have the following and changed to 1000 from 360.
<forms name=MyAppName timeout="360">
<forms name=MyAppName timeout="1000">
I will let you know if that would work.
Also I have formated my date field to mm/dd/yyyy and shows correctly from the VS but from the production server, it shows mm/dd/yyyy hh:mm:sss.
That's odd! Why is it showing time?
Business Accounts
Answer for Membership
by: rlogPosted on 2009-11-03 at 23:10:39ID: 25737080
Hi dkim
couple of tips
1) List the connection string (you may disclose your servernames) and port specification
2) What user is connecting to the database?
3) "I used a lot of datasource" - what do you mean? Do you use a system dsn?
4) What does your sql server say? See in the server log - do you get any access denied messages?