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,590 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

726 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