473,545 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

timout error on server running vb .net routine

I'm getting the following error - not always, only randomly - when I run a
certain routine (the routine is a simple executenonquery and it appears to
complete despite the message) against sql server 2000:

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

Anyone have any idea what causes this and how to avoid it?

Thanks for any help.

Bernie Yaeger
Nov 20 '05 #1
2 1529
Bernie:

There are two timeouts in SQL Server that you want to think about.
Connection Timeouts and Command Timeouts. Connection Timeouts occur when
you try to open a connection but are unable to for longer than the default
period of time. You can only adjust this in the connectionstrin g b/c the
TimeOut property is read-only...hence, once you create your connection
string, this can't be changed. Now, once you have a connection, theh
Command object has a timeout too. So, if you set the Command.TimeOut to 30
seconds and the query took 35 seconds, you'd get an exception. This is
easier to deal with b/c you can just bump it up.

The big problem though is why it's taking so long to execute. Most inserts
should take a fraction of a second for one record so I'd probably look to
Sql Profiler and see what's happening. Unfortunately, htere's not just one
thing that causes Command Timeouts, there are tons of things it could be.
Connection timeouts are a little easier to deal with b/c it's usually that
the server is down, no connections are available, your network cable is
loose, stuff like that.

Does it happen predictably? If so, that may help isolate it. Also, is it a
test server or a production server? If it's a production server, look to
see what's happening in the background (reindexing for instance or
updatestats may cause a temp lock on the db and may be causing this.

If you can, run a trace and see if that doesn't tip you off.

HTH,

Bill
"Bernie Yaeger" <be*****@cherwe llinc.com> wrote in message
news:uR******** ******@TK2MSFTN GP09.phx.gbl...
I'm getting the following error - not always, only randomly - when I run a
certain routine (the routine is a simple executenonquery and it appears to
complete despite the message) against sql server 2000:

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

Anyone have any idea what causes this and how to avoid it?

Thanks for any help.

Bernie Yaeger

Nov 20 '05 #2
Hi Bill,

Thanks for your response. The issue was this: before undertaking important
routines I copy a 750,000 table to a bu table - this runs in a stored proc
that I call via executenonquery . I solved the problem by simply changing
the commandtimeout property to 600 (10 minutes).

Tx for your help, as always.

Bernie

"William Ryan eMVP" <do********@com cast.nospam.net > wrote in message
news:er******** ******@TK2MSFTN GP10.phx.gbl...
Bernie:

There are two timeouts in SQL Server that you want to think about.
Connection Timeouts and Command Timeouts. Connection Timeouts occur when
you try to open a connection but are unable to for longer than the default
period of time. You can only adjust this in the connectionstrin g b/c the
TimeOut property is read-only...hence, once you create your connection
string, this can't be changed. Now, once you have a connection, theh
Command object has a timeout too. So, if you set the Command.TimeOut to 30 seconds and the query took 35 seconds, you'd get an exception. This is
easier to deal with b/c you can just bump it up.

The big problem though is why it's taking so long to execute. Most inserts should take a fraction of a second for one record so I'd probably look to
Sql Profiler and see what's happening. Unfortunately, htere's not just one thing that causes Command Timeouts, there are tons of things it could be.
Connection timeouts are a little easier to deal with b/c it's usually that
the server is down, no connections are available, your network cable is
loose, stuff like that.

Does it happen predictably? If so, that may help isolate it. Also, is it a test server or a production server? If it's a production server, look to
see what's happening in the background (reindexing for instance or
updatestats may cause a temp lock on the db and may be causing this.

If you can, run a trace and see if that doesn't tip you off.

HTH,

Bill
"Bernie Yaeger" <be*****@cherwe llinc.com> wrote in message
news:uR******** ******@TK2MSFTN GP09.phx.gbl...
I'm getting the following error - not always, only randomly - when I run a certain routine (the routine is a simple executenonquery and it appears to complete despite the message) against sql server 2000:

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

Anyone have any idea what causes this and how to avoid it?

Thanks for any help.

Bernie Yaeger


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1446
by: RonHiler | last post by:
Hi guys, I run a game server (for a game I'm writing in development). I had a routine on my web site which detected if the server was up or down and displayed a icon, so that people could see from the web page if the server was working or not. I just changed where my web page is hosted, and the routine no longer works, and I can't...
2
1190
by: Dean g | last post by:
hi, i'm trying to upload some large files off my website to the server. It works fine for small files but the large ones timeout. i changed the timeout to 3600 secs using server.scripttimeout=60*60 but this doesnt seem to help for some reason. does anyone have any ideas on this, i would post some code but i have 4 pages worth just for the...
2
2528
by: Matt | last post by:
I am having trouble with the HttpWebRequest.GetRequestStream method. I am posting data to my web server running NT4 iis4 using a loop. So every time the loop executes I want it to post data to my web page. It work the first 2 times the loop iterates, but on the third time around it gives me a timout error. The line it gives me an error...
0
896
by: Agnes | last post by:
the application run in my office is very well. However, as it move to the client's company, Timeout and general network error always happend. We found that the firewall had a default setting "if it detect a idle connection , it will cut it". So, if the user open the application and leave it alone around 2-3 mins, When he back to the system,...
2
2128
by: tshad | last post by:
This has been driving me crazy. I have been trying to get the error handling working on my system and can get parts of it working and others won't work at all. I found that you can't access session variables from Application_Error event, but I need to so I don't need to set up traces to see what they are during an error. I am emailing...
8
9557
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> Uninstalled old version, installed new version, and am now trying to use the CLP. <<<<<<<<<<<< For more detailed help, refer to the Online Reference...
2
1891
by: Andy | last post by:
Hi there, I have an asp.net 2 web application with SQL Server 2005 db, running on IIS6. I have implemented some error trapping in the global.asax file, along the lines of: void Application_Error(Object sender, EventArgs e) { Exception ex = Server.GetLastError(); //write details about the exception to a table in the db etc etc
7
13735
by: =?Utf-8?B?SmFzb24=?= | last post by:
Hello, can someone please suggest to me how I can keep my ftp connection from timing out after a large file download? I am using SSIS and I have tried multiple ways of ftp'ing the files in my directory to my local hard drive, but the tasks keep failing after a large file is downloaded. The error I'm getting is: An error occurred in the...
0
2543
by: rjr1328 | last post by:
After laboring forever on ASNCLP connection scripts, build all the pieces of a replication process, I find that I am stuck on what seems to be a simple error. I am to replicate from one Redhat linux box to a similarly configured linux box using DB2 v9.5. I am replicating from a database LXCARDS to the database LXDBCARD. The capture server is...
0
7484
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5997
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1902
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.