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,558 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
 
LVL 7

Expert Comment

by:gopaltayde
ID: 37756220
Before disposing the connection object, close it. This should be done throughout the application.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now