Query Timeout Expired Using SELECT/WHERE

G

Guest

All,

I am using C# to a SQL Server 2005 database using an SqlDataAdapter,
SqlCommand and SqlDataReader.
When running the query I receive the following exception:
"Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding."

Does anyone know how to increase the timeout value for a query?
Thanks in advance,

Scott
 
M

Marina Levit [MVP]

Set the CommandTimeout property of the SelectCommand property of the
SqlDataAdapter object you are using.
 
J

Jeff Dillon

But increasing the timeout should always be the last resort. You should perf
tune your query

Jeff
 
J

Jeff Dillon

Using Query Analyzer, you can turn on various settings like Graphical
Showplan.

Is this just a single query?

Can you can also just post the code here, with appropriate table definitions
and sample data.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top