Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Score.aspx page.When it is opened i am getting the follwing error.This page is working in my system.When i put the precompiled copy in clients machine the following error occurs.So plz help me




MSIL
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Exception: Error in Scoring_Definition:Delete()-> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. 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.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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at CreditInvest.ReportScore.Delete() in C:\Users\abhilash\Desktop\24 Sep 2010 second edition\CreditInvestV3\CreditInvest.Class\Reports\Scoring\ReportScore.cs:line 253 at CreditInvest.ReportScore.Delete() in C:\Users\abhilash\Desktop\24 Sep 2010 second edition\CreditInvestV3\CreditInvest.Class\Reports\Scoring\ReportScore.cs:line 257 at CreditInvest.score.Page_Load(Object src, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at CreditInvest.Page.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.ciadmin_score_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
home
Posted

Put a breakpoint on this

CreditInvest.ReportScore.Delete() in C:\Users\abhilash\Desktop\24 Sep 2010 second edition\CreditInvestV3\CreditInvest.Class\Reports\Scoring\ReportScore.cs:line 253

and check the command that method is executing, you may want to use System.Diagnostics.Debug.WriteLine()
 
Share this answer
 
Please include your code in Try. Catch.
And Let us know the specified Error.

I think this Error mostly occurs while connecting to Database,

Check whether you can connect to DB.

-Update.

You could use Connection Timeout=30 inside your sql connection string in web.Config

or see the article for further understanding.

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(VS.71).aspx[^]

Please vote and Accept Answer if it Helped.
 
Share this answer
 
v3
Comments
deepak thomas 30-Sep-10 5:54am    
yes i am able to connect to DB using windows authentication.
Hiren solanki 30-Sep-10 5:56am    
are you getting this problem everytime you run ?
deepak thomas 30-Sep-10 5:58am    
i am getting all the other pages before this one
Hiren solanki 30-Sep-10 6:01am    
I think you are firing such a query which creates load on db and lead it to timeout expiration.
deepak thomas 30-Sep-10 6:02am    
so what should i do?is it possible increase the timeout?
Try these things..

1.
The solution is simple, change the CommandTimeout
(objCmd.CommandTimeout = 0) property of your SqlCommand object. The Connect Timeout attribute of a connection string determines how long a SqlConnection Object runs before it stops attempting to connect to a server.

2.
Or, do you have Connection Lifetime=60 or connection timeout=60 property for connection string.

3.
XML
<system.web>
   <customErrors mode="Off"/>
   <httpRuntime appRequestQueueLimit="100" executionTimeout="60000" />
</system.web>
 
Share this answer
 
Increase value for Timeout of your SQL Connection & SQL Command

For Connection in Web.Config,
<add key="ConnectionString" value="server=(local); uid=sa; password=sa; database=master;Connection Timeout=30"/>

For Command,
C#
public void CreateSqlCommand()
{
   SqlCommand cmd = new SqlCommand();
   cmd.CommandTimeout = 15;
   cmd.CommandType = CommandType.Text;
}
 
Share this answer
 

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