• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1645
  • Last Modified:

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

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
Loganathan Natarajan
Asked:
Loganathan Natarajan
1 Solution
 
Rahul AgarwalTeam LeaderCommented:
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
 
BuggyCoderCommented:
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
 
paunraj21Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
gopaltaydeCommented:
Before disposing the connection object, close it. This should be done throughout the application.
0
 
ingriTCommented:
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
 
Loganathan NatarajanLAMP DeveloperAuthor Commented:
I have added  sqlCommand.CommandTimeout = 0; I solved this issue.
0
 
Anthony PerkinsCommented:
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
 
Loganathan NatarajanLAMP DeveloperAuthor Commented:
This Solution worked for my issue
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now