Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timeout error execute simple statement
Message
From
25/10/2005 19:28:17
 
 
To
25/10/2005 18:15:32
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01062069
Message ID:
01062094
Views:
17
Greg,

I think the problem is because you're opening the connection and leaving it open. This is not something you want to do unless you're working with a Transaction. If you are simply filling DataSets or DataTables in a DataSet, then the DataAdapter.Fill() method automatically opens and closes the connection as needed. Can you post more of your code?

~~Bonnie



>Hi All,
>
>Recently, I am getting the following error when selecting rows for a single table.
>
>
>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.
>

>
>Here is the code.
>
>
>
>SqlConnection Connection = null;
>Connection = new SqlConnection( myConnectionString );
>Connection.Open();
>
>SqlCommand myCommand;
>myCommand = new SqlCommand( "SELECT * FROM Node " );
>
>
>The error occurs on the last line in the code above. The interesting thing is it did work before I added a new table to the database. I have not even added the code to access the new table yet. And it performs other SQL Select statement (2 actually) before attempting this one.
>
>Can anyone help me understand why I would be getting this error?
>
>Thanks
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform