Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
1,616 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 13

Expert Comment

by:Rahul Agarwal
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
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 SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

718 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