Re: Microsoft OLE DB Provider for SQL Server error '80040e31'
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 19 Apr 2006 22:02:28 +0000 (UTC)
Raj (Raj@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
I'm getting the Timeout error in one of my ASP application. I'm calling a
slight complex stored procedure which is running fine when run
in the Query Analyzer.
Does fine mean that it executes in less than 30 seconds, or does
1 minute count as "fine"?
But when it is called from the ASP code in certain cases when the number
of records are more it is giving the following error message:
Microsoft OLE DB Provider for SQL Server error '80040e31'
Timeout expired
By default most client APIs has a default timeout of 30 seconds. (A
completely idiotic idea if you ask me.)
Following is the code I'm using to call the stored proc.:
Set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = conn
cmd.CommandText = "Sel_MOD_Changes"
Set rs_Item = cmd.Execute(recsAffected, Array(POSEQNUM), adCmdStoredProc)
Add conn.CommandTimeout = 0 to set an infinite time out. Do this before
you create the command object.
You can also set the CommandTimeout on the command object if you like.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Prev by Date: Re: SQLOLEDB vs Query Analyzer performance (not parameter sniffing)
- Next by Date: C# code to convert HTML file into RTF file format
- Previous by thread: Re: Can't connect to SQL server
- Next by thread: C# code to convert HTML file into RTF file format
- Index(es):
Relevant Pages
|
Loading