Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All, I am having an issue with an aspx where it takes too much (more than 1 min) to execute a page as it only takes 2 second in sql server to execute the same query where i am calling from aspx page.

I didn't understand why the aspx page takes too much time?

and below is the event log
3005
An unhandled exception has occurred.
11/10/2012 1:43:27 PM
11/10/2012 9:13:27 AM
53839f62829940c8a1665b4a2f2cefc7
1551
57
0
/LM/W3SVC/1/ROOT/bg-1-129970041412864159
Full
/bg
C:\inetpub\wwwroot\BG\
NSP-WEBSERVER

4616
w3wp.exe
IIS APPPOOL\RBG
SqlException
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
http://192.168.0.17/bg/Report/CDCDetail/Default.aspx
/bg/Report/CDCDetail/Default.aspx
True
Forms
IIS APPPOOL\RBG
6
IIS APPPOOL\RBG
False
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.GridView.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thanks
Posted
Updated 9-Nov-12 22:30pm
v4
Comments
bbirajdar 10-Nov-12 4:39am    
And where is the code? Did you debug to check where it takes more time to execute. ???
Nelek 10-Nov-12 7:04am    
Op answered you in comment below
bbirajdar 10-Nov-12 10:05am    
@Nelek.. Are you sure it is an 'answer' ?
Nelek 10-Nov-12 11:15am    
Well, yours was the only comment and he told thanks. I supposed he wanted to speak with you. If what he says makes sense or can be considered as "answer"... is free to your imagination ;P
Abdul Rahman Hamidy 10-Nov-12 7:46am    
Thanks, there is no error, a very simple page (GridView + SqlDataSource), calling procedure in sql server. and it takes long time to execute page but a second in sql server 2k5.

Wellll, it's bloody obvious from the exception message you got that your code cannot connect to the SQL Server. Without seeing your code and the connection string you used, it's impossible for anyone to tell you how to fix it.
 
Share this answer
 
v2
Comments
Abdul Rahman Hamidy 10-Nov-12 23:34pm    
Thanks, I run sql profiler while executing the page and i did find the procedure in profiler. I copied the procedure from profiler and run it in SSMS (Management Studio) and it runs in a second but in page it gives that exception.

below is the connection string in config file in side tag. (other pages are running correctly)

name="ConnString" connectionstring="Server=something; Initial Catalog=DBName; User ID=User; Password=password; Connection TimeOut=180;" providername="System.Data.SqlClient"

and also the sqlDataSource in the page

<asp:SqlDataSource ID="sqlgvCDCDetail" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnString %>"
SelectCommand="GetCDCDetail" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="rID"
SessionField="RegionID" Type="Byte" />
<asp:SessionParameter DefaultValue="0" Name="pID"
SessionField="ProvinceID" Type="Byte" />
<asp:SessionParameter DefaultValue="0" Name="dID"
SessionField="DistrictID" Type="Int16" />
<asp:SessionParameter DefaultValue="0" Name="bgTID" SessionField="BgTypeID"
Type="Byte" />
<asp:SessionParameter Name="fID"
SessionField="FPID" Type="Byte" />
<asp:SessionParameter Name="usrName" SessionField="UserName"
Type="String" />
</SelectParameters>
Dave Kreskowiak 11-Nov-12 9:56am    
The other pages that are running OK, are they using the exactly same connection string??

It takes so long to run this page because the connection timeout is 180 seconds. I'm guessing that your page takes 3 minutes to give you the failure message you posted.

You might want to verify the connection string. If those are the unaltered parameters, you've got them very wrong.
solved. clear the cache and everything went smooth. (Just to close thread)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900