Sql server 如何增加实体框架和;Sql Server

Sql server 如何增加实体框架和;Sql Server,sql-server,entity-framework,Sql Server,Entity Framework,我正在asp.NETMVC5中开发一个实体框架。sql server速度非常慢,因此每当我尝试访问连接到Db的页面时,都会收到以下错误:- Server Error in '/' Application. -------------------------------------------------------------------------------- The wait operation timed out Description: An unhandled except

我正在asp.NETMVC5中开发一个实体框架。sql server速度非常慢,因此每当我尝试访问连接到Db的页面时,都会收到以下错误:-

Server Error in '/' Application.
--------------------------------------------------------------------------------


The wait operation timed out 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.ComponentModel.Win32Exception: The wait operation timed out

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 
但是我找不到一种方法来增加实体框架类中的超时? web.config中的我的连接字符串如下所示:-

<add name="***Entities" connectionString="metadata=res://*/Models.Model2.csdl|res://*/Models.Model2.ssdl|res://*/Models.Model2.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=*******;initial catalog=TMSres;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

如何增加实体框架和Sql Server之间的超时会话

Thnaks

您可以通过设置

// Specify a timeout for queries in this context, in seconds.<br>
context.CommandTimeout = 120;
//指定此上下文中查询的超时时间(秒)。
context.CommandTimeout=120;

可能存在的副本