.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Timeout Error - 30 seconds - When runing long Querys

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net

Hello all,

I am having problems of Timeout on my Application using Ajax Toolkit, more precisely when runing long Querys on SQL Server.

I have tryed all solution that I found os forums like:

- change the AsyncPostBackTimeout os Toolkit ScriptManager.

- Set the CommandTimeout = 60000 of the SqlCommand.

- Add Connect Timeout on Connection String.

- Add <sessionState mode="InProc" timeout = "60000" sqlCommanTimeout="60000"> on webconfig

I'm testing with a query that run normally on ManagementStudio in 50 seconds approximately, but on Application breaks with this error bellow on 30 seconds. Occurs on any browser, runing from IIS or from VS, wherever...

I'm forgoting something?  please any help..


Mensagem: Sys.WebForms.PageRequestManagerServerErrorException: The timeout period elapsed prior to completion of the operation or

View Complete Post

More Related Resource Links

'Unspecified error' doing sp_xml_preparedocument on XML element with a long attribute

In SQL Management Studio 2008 (connected to SQL 2005 database), I get this:The XML parse error 0x80004005 occurred on line number 2, near the XML text "<item value="&#xD;&#xA;libname...Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocument, Line 1The error description is 'Unspecified error'.When I do this declare @doc nvarchar(max), @idoc int set @doc = '<item value="&#xD;&#xA;libname..." />' EXEC sp_xml_preparedocument @idoc OUTPUT, @doc when the value of the @value attribute is actually a string of somewhat over 830000 characters.If I truncate the string somewhat, the statements execute successfully.Anyone know how to fix this?  (and "use shorter attributes" is not an acceptable answer :-)I would use XQuery except that I can't figure out how to get the equivalent of @mp:id and @mpparentid to give me the hierarchical structure information I need.  If anyone knows how to do that, I'd appreciate a hand there too!  

Timeout error - The timeout period elapsed prior to completion

Hi, I'm using ASP.NET 3.5 (c#) with SQL Server 2008 server. Recently, I started getting error "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.". After looking at forums for solutions, I added the below common code to my application. protected DbCommand CreateCommand() { SqlCommand sqlCommand = new SqlCommand(); sqlCommand.CommandTimeout = 600; // 10 minutes return sqlCommand; } However, intermittently, I'm still getting the timeout error. I added the logging to see where error is occuring. And found that before executing one of the query, it is giving this error. Now, my assumption is that I should have received this error after runnign query for 600 seconds (10 minutes) since I set it in the above function. But the timeout error is occuring instantaneously within 1 second itself. In the log, I printed one line above & after the query to identify how much time it would take. Surprisingly, the log says that 9:00 AM "Before query execution" & at 9:01 AM "timeout expired...." I would really appreciate if some one can help me out here! Thanks!

Page Reload after TimeOut Error

I have a Web app using Forms authentication. I Use Timeout in Web.Config to TimeOut from application that is working fine and I am Redirected to Login page with Message on page "The application timed out. Please ClockIn/Login."  When I am Logging again I am Redirected to the same page with same error message and after that if I try Logging again second time I am able to Login. Following is the code from different form which i am using. Web.Config     <sessionState timeout="2">        </sessionState>    <authentication mode="Forms">      <forms loginUrl="Login.aspx" protection="All" timeout="2" slidingExpiration="true" defaultUrl="Home.aspx">      </forms>    </authentication>    <authorization>      <deny users="?"/>    </authorization>Global.aspx protected void Application_AcquireRequestState(object sender, EventArgs e)        {            if (System.Web.HttpContext.Current.Session != null)            {&nb

Get error on runing Package - ComVisible

hi all im try to run a simple package with 2 Execute SQL Task and im get this error : Error: The Execute method on the task returned error code 0x80131509 (This type has a ComVisible(false) parent in its hierarchy, therefore QueryInterface calls for IDispatch or class interfaces are disallowed.). The Execute method must succeed, and indicate the result using an "out" parameter. any help

Request.GetRequestStream() in a loop gives Timeout error

Hi,     I tried searching the net but didnt find any relevant information regarding this issue, I am trying to pass data to a servlet and am sending it in a loop as a different request everytime , after the second request the debugger  just hangs on this statement Request.GetRequestStream() and comes back after a lot of time or either gives a timeout error   Following is the code   try { log.Info(xmlTrade); UTF8Encoding encoding = new UTF8Encoding(); byte[] bytes = encoding.GetBytes(xmlTrade); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(tradeServletPath); log.Debug("Servlet Path: " + tradeServletPath); request.Method = "POST"; request.ContentType = "text/xml"; request.ContentLength = bytes.Length; request.Timeout = timeout; Stream stream = request.GetRequestStream(); try { stream.Write(bytes, 0, bytes.Length); } finally { stream.Close(); } return "Success"; } catch(Exception ex) { log.Error("Exception occured when submitting this trade xml: " + xmlTrade); if(ex.Message.StartsWith("The underlying")) return "Connectionerror"; else return string.Empty; }

SQL 2005 open connection timeout error


We have Microsoft SQL Server 2005 - 9.00.4207.00 (X64)  Enterprise Edition (64-bit) on Windows server 2003 (Build 3790: Service Pack 2) .

Periodically (~ once per 15 min) some db-clients have error messages when open connection (over SQL Native Client ) like:

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

All timeouts more or equal 15 sec. Less then 15 sec is not acceptable by business rules. Performance counters (cpu,memory,disk etc.) on server does not show bottleneck. Only one sql counter - logins/sec show trouble. When problem exists then this counter = 0. Also dramatically decrease many other counters - sql batch requests/sec, transactions/sec, cpu load and some ones. SQL Server "sleep" few seconds (4 - 5) and then accessible again.




WCF Hosting on iis and long runing request

We have a problem with long running request on our server. If request last more than 15 minutes, client doesn't get the response. We have set all possible timeout on binding and on  system.web httpruntime executionTimeout. We can see in the log that request ends on the server but the client doesn't get the response - client wait's until the timeout period expires (120 minutes) and than throws timeout-exception. Can any one tell us what could be possible cause of that behavior?

Dealing with timeout on long SP execution


I am executing a stored procedure that takes about 75 seconds to execute. My page times out while it tries to wait for the resultset. I tried adding Connect Timeout=200; pooling='true'; Max Pool Size=200" but it still times out.

I guess I do not necessarily need to wait for the result set. Is it possible to just send the SQL command with something like (making it up:) command.ExecuteOnServerAndDoNotWait  ?


Here is my code:


Using connection As New SqlConnection("Data Source=Rosebud;Initial Catalog=lovebug;Persist Security Info=True;User ID=notME;Password=L0v3ly;Connect Timeout=200; pooling='true'; Max Pool Size=200")
            Dim command As New SqlCommand("exec CalculateDataUsage @Customer,@CNumber,@Month,@Year,@TypeOfEntry,@Usage", connection)
            'CalculateDataUsage] @Customer varchar(50),@CNumber varchar(20), @Month varchar(5), @Year varchar(5), @TypeOfEntry varchar(20), @Usage numeric OUTPUT
            command.Parameters.Add("@Customer", Data.SqlDbType.VarChar)
            command.Parameters.Add("@CNumber", Data.SqlDbType.VarChar)
            command.Parameters.Add("@Month", Data.SqlDbType.VarChar)
            command.Parameters.Add("@Year", Data.SqlDbType.VarChar)

Getting Timeout expired error in Local reports


Hi all,

I am using local reports(rdlc) fils for reports generation in asp.net I am getting timeout expired error when i have more number of records. I am able to view the preview if there is less number of records. I have also added following code in by Submit button. I have tried by giving Connect TimeOut=3600 in Web.confing file at Connection. But not worked. I am using stored procedure to get the records and it was executed with in 3 secs. Very urgent give me any solution.

I have also tried by adding following code also.

da.SelectCommand.CommandTimeout = 0



Timeout error from same server but different websites







Hi to all, this is maybe my first time that I have post a question, and it is just because I ran out of ideas... so maybe someone can offer a solution.

First the environment:
OS: Windows Server 2003 R2 - 5.2.3790
Microsoft SQL Server Management Studio        10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft SQL Server Express 2008
Microsoft Data Access Components (MDAC)        2000.086.3959.00 (srv03_sp2_rtm.070216-1710)
Microsoft MSXML                    2.6 3.0 4.0 6.0
Microsoft Internet Explorer            7.0.5730.13
Microsoft .NET Framework            2.0.50727.3615
IIS 6.0
Intel Xeon CPU 2.8 GHz, 2.79 GHz, 3.5 GB RAM.

I have a website running on this server let us name: the SiteOne which is physically stored in inetpub, and it works fine. within this site I have a .Net Web Page with nine graphs, it pulls the data from 7 SQL Express queries with the production of the day. Showing the graphs takes to the site 2 seconds the most. However, I was in the need to copy the websi

Long to Int Implicit Convertion Error??



i have this type of code

long expiry_days = 121212212; //some long value here

if (expiry_days < 0)
                    return expiry_days;

but compiler issue a error that it can not convert long to int implicitly. My question why its require convertion here but there seems to be no need to do that :(. i rather assume that might be compiler inferring it from the if condition comparison i just change it to (expiry_days >(long)0) still same result why???

Thanks for Expert Opinions.

[Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]


Hello All,

I am using MS SQL SERVER 2008. Im making an application which queries trillion of records. Im using PHP as scripting language. For those functions , which query database and 200 (approximately) rows of DB are returned, everything works fine. But if I query database and a large recordset should be returned, the following error is thrown:

Array ( [0] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258

=> 258 [2] => [Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]. [message] => [Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]. ) [1] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258
=> 258 [2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure ) [2] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => -2147467259
=> -2147467259 [2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure ) )

If I see the error log it shows:

2010-10-17 12:32:38.88 Logon       Error: 18456, Severity: 14, State: 8.

2010-10-17 12

'The page took too long to save...' error and IE8

Hi people,

I have installed Intenet Explorer 8 and started experience a problem. When my publishing page is in Edit mode and I click any link to navigate out to a different page IE8 prints 'Saving Page Content...' in its status bar for about 20 seconds and then displays a message box 'The page took too long to save...'. There were no such error with either IE7 or FireFox. After playing with Javascript debugging, I found that SBN_CallBackHandler() client function of SaveBeforeNavigationControl is not called as it supposed to. It looks like the implementation of XMLHttpRequest object in IE8 is somehow different from the previous release. I'm not sure if it is a bug of IE8 or SharePoint javascript but the problem exists. Fortunatelly, IE8 allows you to turn off its advanced setting 'Enable native XMLHTTP support' (enabled by default) in menu Tools/Internet Options/Advanced. It solves the problem but I would like to have more correct solution :-)  Any ideas?

Rich Text editor comes up with random error The Page took too long to save. You can click "Cancel",

I seem to get a random error when i open the rich text editor in a content editor web part and try to save the changes.

The error i get is:
Are you sure you want to navigate away from this page?
The page took too long to save. You can click "Cancel", and then try to save the page again. If you click "OK", you might lose unsaved data.
Press OK to continue, or Cancel to stay on the current page.

If i click OK it seems to save the changes but this problem is very annoying and users are obviously worried when they see this error.
Does anyone have any ideas what is causeing this error across the entire site? and are there any fixes?

thanks for your time,

Tony Phillips

Really Long JSON String wraps to multiple lines in source, creates unterminated String Literal error


I have an app that writes a JSON object to a string and registers a script block onto the page that client-side javascript then uses to build interface components.  I found that the javascript is working fine when the data set is small, but on large datasets, when I view the source, the JSON object string takes up a few lines because it is so long.  I didn't think anything of it until I started manually trying to recreate the "Unterminated String Literal Error", only to find that the error goes away when I format the JSON string to be a little more "readable".  What I discovered is that this does away with the automatic new line wrap, making the error go away. 

Make Sense?  Is there anything I can do about this?

index and timeout error



I notice there is a relation between a table index and ado error(few modificaions, updates commands),

If I disable the index, and no error, otherwise, weill get in the ado error:
Error Detail: Timeout expired
Error Source: Microsoft OLE DB Provider for SQL Server

Can someone help me track deeper? Is it a deadlock caused by the index and udpate sql?

Thanks in advance.

Timeout connection error during


I have this strange problem during executing my dynamic data page:

Timeout. The available time expired prior to the completion of the operation or the server is not responding.
Description: Exception has been handled during execution of the current Web request. For more information about the error and where it originated in the code, see the stack trace.

Exception details: System.data.SqlClient.SqlException: Timeout. The available time expired prior to the completion of the operation or the server is not responding.

In debugger mode, the error is in the method:

public DynamicDataEntities(global::System.Data.EntityClient.EntityConnection connection) :
                base(connection, "DynamicDataEntities")

of my DynamicDataModel.designer.cs
in my solution.

But I have not other problems.

How can I solve?

Thanks in advance.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend