I'm using VS 2005. My project incorporates a Business Logic Layer and a Data Access Layer. The Table Adapter in the DAL is configured to run a stored procedure in SQL Server 2005. If the web application were to run to completion, the stored procedure would add about 500 rows to an existing table in SQL. When I run the sproc in SQL Server Management Studio, it takes about 45 seconds to complete. When I run my app on localhost, it throws the Timeout exception after 30 seconds. I've tried all the suggestions posted here (except the WITH (NOLOCK) because the sproc has 20 tables and several subqueries in it) and no matter what I have tried, the exception pops up after 30 seconds.
Here's the stack trace & I've highlighted where it blows up:
[SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +862234
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739110
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +903
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
SunwestODSTableAdapters.RentRateTableAdapter.sw_ProcessResidentRentIncreases(Nullable`1 NotificationMonth) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\rentmgmt\86e70563\dc6a7260\App_Code.989tz2lc.4.cs:6276
RentRateBLL.sw_ProcessResidentRentIncreases(Int32 month) in i:\IT\Applications\Rent Management\RentMgmt\App_Code\BLL\RentRateBLL.cs:89
ResidentData_CalculateResidentRentIncreases.CalculateRents_Click(Object sender, EventArgs e) in i:\IT\Applications\Rent Management\RentMgmt\ResidentData\CalculateResidentRentIncreases.aspx.cs:27
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Help!