Solved

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

Posted on 2012-03-22
8
1,570 Views
Last Modified: 2012-03-28
While Running Sql Query From Website. I get an error. The same query works for other Clients. For a Particular Client the other queries are working. but one query is not being executed. While Executing the query I get
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding"
Error. I need your suggestions to fix it. I have increased Time out in web config. but then could not get the result. any other ways to do it.
0
Comment
Question by:Loganathan Natarajan
8 Comments
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 37755885
May be this is due to the network connection with SQL Server. or Optimize the SQL query by putting index

SELECT column_list FROM table_name WITH (INDEX (index_name) [, ...]);
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37755906
share your query and try to run it in ssms.
Also please check the execution plan and see what is the disk read cost and cpu cost.

This kind of problem in generally with query, also try writing SP for that so that Execution plan can be pregenerated.
0
 

Expert Comment

by:paunraj21
ID: 37756048
My suggestions is to reduce the SQL query execution time. You know, there are some ways to do Optimize the SQL queries. Optimize the SQL query by putting index or limit.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 7

Expert Comment

by:gopaltayde
ID: 37756220
Before disposing the connection object, close it. This should be done throughout the application.
0
 
LVL 6

Expert Comment

by:ingriT
ID: 37756365
Are there any other queries running at the same time on one of the same tables? There could be a lock that it's waiting for.
0
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 0 total points
ID: 37756828
I have added  sqlCommand.CommandTimeout = 0; I solved this issue.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37762955
I have added  sqlCommand.CommandTimeout = 0; I solved this issue.
For the record this is a very bad solution and should never be used.  It translates to:  "I don't care how long the query takes the user can wait indefinitely."  There are far better ways of solving this problem.
0
 
LVL 36

Author Closing Comment

by:Loganathan Natarajan
ID: 37775649
This Solution worked for my issue
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question