Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timeout problem in visual studio 2005

Status
Not open for further replies.

deb18

Programmer
May 19, 2003
40
US
I am trying to add a query to a tableadapter in visual studio 2005. It is a long running query that cannot really be tuned further. When I add it to the table adapter the parameters show up listed but the results fields do not. No error message yet. Then when it goes on to generate the methods it times out after about 30 seconds with the error message:
An unexpected error has occured.
Error message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

I have already raised the timeout value in Tools/Values/Table and Database designers and Tools/Values/Query and View Designers. Is there anything else that I can do?
 
There are two timeouts to consider - the first is the connection timeout. Raising this will not help long running queries as this timeout only relates to how long the application will wait for a connection to be created.

The second is the command timeout - this is the important one for long running queries. If your data is being returned through a data adapter, you can increase the timeout by:
Code:
da.SelectCommand.CommandTimeout = 60;
where da is your DataAdapter.
 
SHelton, Thank you for your response.
The problem is that I am having a problem at design time when adding the stored procedure to a tableadapter in Visual Studio 2005
 
Ah. Using the design time components for data access is quick, but I don't know if it gives you as much control over the underlying connection and commands.

I personally build most of my data objects in code, so I can't really help I'm afraid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top