I get this error when i am uploading a file, It times out within 35 secs.
Works fine at the development server but not on the Pre-Prod .
Can anyone suggest me as to what could be the problem ??
I was getting the same error [may be due to some heavy load process is happening on DB, but still my query/sp runs with excellent speed, but all these commandtimeout settings, I doubted, as it requires more understanding the effects of changing.
but I solved the error by keeping
WITH
(NOLOCK) option for every table name mentioning... it works like Magic!
for ex: select * from Employee e WITH
(NOLOCK)
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Dim ObjConn As System.Data.SqlClient.SqlConnection
Dim Dt As
New Data.DataTable ObjConn =
New Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings.Item("Connectionstring").ConnectionString)
If ObjConn.State = Data.ConnectionState.Closed
Then
ObjConn.Open()
End If
Dim Da
As New Data.SqlClient.SqlDataAdapter("SELECT * FROM...", ObjConn)
I had this happen to me in SQL Server directly, using Design View on my table. I could make my change (which was to the width of an nvarchar field), but when I went to save it, that's when I'd get this error. The table itself wasn't even open when the
error occurred, so that wasn't it. So I tried a SQL query and that worked (ALTER TABLE mytable ALTER COLUMN myColumn nvarchar(newWidth)). I checked Design View and it showed it worked. I changed it back to the old value in Design View and tried saving it
- same error again.
I figured it had to do with the fact I have 3 million records and how long it must take to update them all. I had "Remote query timeout", in the Connections window on the SQL Server Properties dialog, set to 0, which should've meant an unlimited period,
but it didn't. I set this to 1200 and magically it saves my new field width for the column I wanted to change. Hope this helps someone.
The post is 5 years old but I ran into this with a DNN site and there were a few things to correct:
1) Sign in to Sql 2008 Exp as SA and make sure the timeout is adequate -- it was, at 600 seconds.
-- I also had a permissions issue with dropping indexes and re-adding them for what I was doing so there was more to do than just this. This error was the last thing to fix.
2) Tried the webconfig setting in the connection string but this didn't fly.
3) I'm working in Visual Studio so I highlighted the connection, selected Modify Connection | Advanced and sure enough ... there's a default timeout set for 15 seconds.
Having already tested my query for deleting a very huge file, I know it takes just over 2 minutes. Setting the timeout in visual studio (db connection advanced tab) also for 600 seconds seems to have worked.
So if anyone else sees this, here's another solution. A time warp would have been the best answer so that anyone from 2005 forward would have already seen this link.
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
franferns
Member
87 Points
104 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Mar 04, 2009 07:15 AM|LINK
Hi All,
I get this error when i am uploading a file, It times out within 35 secs.
Works fine at the development server but not on the Pre-Prod .
Can anyone suggest me as to what could be the problem ??
Regards,
Francis P.
imransajid
Member
4 Points
3 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Apr 17, 2009 01:42 PM|LINK
I am getting this error when ASP.NET tries to read/write from session. I am using SQLExpress for session provider with following in my web.config.
<sessionState mode="SQLServer" allowCustomSqlDatabase="false" cookieless="false" timeout="20" sqlConnectionString="data source=XXXURLXXX\SQLEXPRESS;user id=yyy;password=zzz"/>
Note webserver and sqlexpress are two different servers with firewall in between.
Any clue or help is appreciated.
Thanks!
kphani_prasa...
Member
33 Points
18 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Jun 16, 2009 12:02 PM|LINK
I was getting the same error [may be due to some heavy load process is happening on DB, but still my query/sp runs with excellent speed, but all these commandtimeout settings, I doubted, as it requires more understanding the effects of changing.
but I solved the error by keepingWITH
(NOLOCK) option for every table name mentioning... it works like Magic!for ex: select * from Employee e WITH
(NOLOCK)Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
devaragam
Member
2 Points
1 Post
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Jun 18, 2009 02:04 PM|LINK
Please note the commandTimeout property
-Prasannakumaran Sarasijanayanan
Dim ObjConn As System.Data.SqlClient.SqlConnection
Dim Dt As New Data.DataTable ObjConn = New Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings.Item("Connectionstring").ConnectionString) If ObjConn.State = Data.ConnectionState.Closed ThenObjConn.Open()
End If Dim Da As New Data.SqlClient.SqlDataAdapter("SELECT * FROM...", ObjConn)Da.SelectCommand.CommandTimeout = 3000
Da.Fill(Dt)
navyjax2
Member
88 Points
45 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Jul 16, 2009 09:48 PM|LINK
I had this happen to me in SQL Server directly, using Design View on my table. I could make my change (which was to the width of an nvarchar field), but when I went to save it, that's when I'd get this error. The table itself wasn't even open when the error occurred, so that wasn't it. So I tried a SQL query and that worked (ALTER TABLE mytable ALTER COLUMN myColumn nvarchar(newWidth)). I checked Design View and it showed it worked. I changed it back to the old value in Design View and tried saving it - same error again.
I figured it had to do with the fact I have 3 million records and how long it must take to update them all. I had "Remote query timeout", in the Connections window on the SQL Server Properties dialog, set to 0, which should've meant an unlimited period, but it didn't. I set this to 1200 and magically it saves my new field width for the column I wanted to change. Hope this helps someone.
-Tom
hinaAsp.Net
Member
246 Points
125 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Aug 19, 2009 09:20 AM|LINK
I wrote Connect Timeout upto 2000 but no change.
If my reply helped you, dont forget to mark it as "Answer"
mdurthaler
Member
4 Points
6 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Aug 21, 2009 04:26 PM|LINK
The post is 5 years old but I ran into this with a DNN site and there were a few things to correct:
1) Sign in to Sql 2008 Exp as SA and make sure the timeout is adequate -- it was, at 600 seconds.
-- I also had a permissions issue with dropping indexes and re-adding them for what I was doing so there was more to do than just this. This error was the last thing to fix.
2) Tried the webconfig setting in the connection string but this didn't fly.
3) I'm working in Visual Studio so I highlighted the connection, selected Modify Connection | Advanced and sure enough ... there's a default timeout set for 15 seconds.
Having already tested my query for deleting a very huge file, I know it takes just over 2 minutes. Setting the timeout in visual studio (db connection advanced tab) also for 600 seconds seems to have worked.
So if anyone else sees this, here's another solution. A time warp would have been the best answer so that anyone from 2005 forward would have already seen this link.
ChrisBeere20...
Member
8 Points
4 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Sep 17, 2009 01:12 PM|LINK
WITH (NO LOCK)
This worked perfectly for me. Thanks :)
jaeastman
Member
4 Points
4 Posts
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Sep 25, 2009 08:45 PM|LINK
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!
roopeshcb
Member
2 Points
1 Post
Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or t...
Oct 22, 2009 06:56 PM|LINK
Thanks Man, I also got the same issue while running a windows application. After i set command timeout it works fine.
Roopesh