Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I wrote an asp.net page that submits a query string to SQL Server. The result is then filled in a dataset, and a report in .pdf is generated from the dataset. If the result is limited to a small set of records, the report is displayed. If the result ends up with larger number of records, I got the following error. The query seems to time out in 35 seconds.

 

I'm not quite sure what causes the timeout problem. Any help is appreciated :) .

 

==========================================================

Server Error in '/LaborDistribution' Application.

 

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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

 

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

 

Source Error:

Line 103: gdsLaborDistributionResult = New dsLaborDistributionLine 104: gdsLaborDistributionResult.Tables("LaborDistribution").Rows.Clear()Line 105: daLaborDistributionResult.Fill(gdsLaborDistributionResult, "LaborDistribution")Line 106:Line 107: daLaborDistributionResult = Nothing

 

Source File: c:\inetpub\wwwroot\LaborDistribution\LaborDistributionQuery.aspx.vb Line: 105

 

Stack Trace:

[sqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.] System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) LaborDistribution.WebForm1.btnSubmit_ServerClick(Object sender, EventArgs e) in c:\inetpub\wwwroot\LaborDistribution\LaborDistributionQuery.aspx.vb:105 System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain()

 

 

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Posted
Either set the sqlcommand object's timeout to a higher number' date=' or optimize your query.[/quote']

 

Thank you for your help. It works!!! :cool:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...