Solved

Timeout expired

Posted on 2015-01-13
13
114 Views
Last Modified: 2015-01-14
I am getting the error "System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding." The strange thing is its only happening from a certain web server. I took the same application to IIS 7 machine and it works fine. I also ran it on my local machine and its fine. The server it refuses to work from is one running IIS 6. Any ideas?
0
Comment
Question by:takwirirar
[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
  • 7
  • 6
13 Comments
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40546920
Please post the query that you are trying to execute.
0
 
LVL 1

Author Comment

by:takwirirar
ID: 40546935
cmd = New SqlDataAdapter("SELECT order_num FROM dbo.orders where status='Awaiting' or status='Received'", cnn)
            cmd.Fill(ds)

            DropDownList4.DataSource = ds
            DropDownList4.DataValueField = "order_num"
            DropDownList4.DataBind()
            ds.Clear()
            cmd.Dispose()

Open in new window


This returns 88 rows when I run it in SSMS
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40546941
The table orders has any index on status column?
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 1

Author Comment

by:takwirirar
ID: 40546947
No index.
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40546956
Depending on how many rows the table has the query can run in more time than the configured timeout. I recommend you to create an index on that column.
0
 
LVL 1

Author Comment

by:takwirirar
ID: 40546965
I have now created index and still getting timeout.

Index
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40546978
Clustered?
How did you create the index?
0
 
LVL 1

Author Comment

by:takwirirar
ID: 40546985
Yes clustered index. I right clicked on Indexes - Create Index - Clustered - on the status field
0
 
LVL 50

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40546993
Drop that index and then run the following command in a new query window:
CREATE INDEX IX_Orders_Status ON dbo.orders (status)

Open in new window

NOTE: You need to run this command in the correct database context.
0
 
LVL 1

Author Closing Comment

by:takwirirar
ID: 40547012
Giving this as answer because it helped in some way. The issue was the DNS configuration of the offending server. It had the Google 8.8.8.8 address that was probably trying to resolve an intranet address which caused the issue. I removed the public DNS, cleared ARP cache and flush DNS. All is working now.
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40548399
So, not a database problem.
Just for curiosity, did you create the suggested index? If so, did you realize any performance boost ?
0
 
LVL 1

Author Comment

by:takwirirar
ID: 40548475
I can't say the performance boost is noticeable but I think having indexes is a great idea anyway. I'll probably have to do some research then ask a question about checking how long transactions take with/without indexes. Perhaps SQL profiler.
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40548485
Yes, you can start by using SQL Profiler to capture long running queries. Those are for sure very good candidates to have indexes.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

728 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