Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
An error occurred while updating the entries. See the inner exception for details. System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)     at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.b__0(DbCommand t, DbCommandInterceptionContext1 c)     at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func3 operation, TInterceptionContext interceptionContext, Action3 executing, Action3 executed)     at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)     at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteNonQuery()     at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary2 identifierValues, List1 generatedValues)     at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()     --- End of inner exception stack trace ---     at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()     at System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.<update>b__2(UpdateTranslator ut)     at System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update[T](T noChangesResult, Func2 updateFunction) at System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update() at System.Data.Entity.Core.Objects.ObjectContext.b__35() at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)     at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)     at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass2a.<savechangesinternal>b__27()     at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction) at System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options) at System.Data.Entity.Internal.InternalContext.SaveChanges() --- End of inner exception stack trace --- at System.Data.Entity.Internal.InternalContext.SaveChanges() at System.Data.Entity.Internal.LazyInternalContext.SaveChanges() at System.Data.Entity.DbContext.SaveChanges()


What I have tried:

Everything from C# Code to SQL Profiler etc.
Posted
Updated 7-Jun-18 0:25am
v2
Comments
Member 13812021 5-Jun-18 11:34am    
You should place some code so we can see what is causing the error.
Dave Kreskowiak 5-Jun-18 11:49am    
About the only thing anyone can tell you from what you've posted is that the SQL Server took too long to finish executing your query, what that is. Nobody can tell you anything more than that because you have shown the query and code that's throwing the error.
[no name] 5-Jun-18 14:13pm    
Maybe you're "piling up too much work" (in memory) before "saving changes".

EF is no replacement for "responsible computing".
j snooze 5-Jun-18 17:13pm    
you could try increasing your timeout, but seems to me the sql code should be faster so I would focus on making sure its efficient.
Maciej Los 7-Jun-18 6:24am    
Not a question at all!

1 solution

the error is related to system timeout.you can see it on the error message as
System.ComponentModel.Win32Exception: The wait operation timed out 


it simply mean that sql take too long to execute your query and the timeout occur.There might be many reasons causing a command executed for a long time like Long running tasks, Server memory pressure, Blocking, Other resource bottlenecks etc:-. Only detail look at the codes and data can provide the exact reason for the timeout.

this link provide some basics on the issue..
 
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