Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 超时已过期。操作完成前的超时时间或服务器没有响应_C#_Asp.net_Sql_C# 4.0 - Fatal编程技术网

C# 超时已过期。操作完成前的超时时间或服务器没有响应

C# 超时已过期。操作完成前的超时时间或服务器没有响应,c#,asp.net,sql,c#-4.0,C#,Asp.net,Sql,C# 4.0,我正在尝试执行此查询: SELECT * from vwLstDtaLines d1,vwLStDtafiles d2 where d1.DtaLinePaymentDate='1/1/2000'or d1.DtaLinePaymentDate='1/1/2012' or d1.DtaLineUserCre='abc' or d1.DtaLineUserMatch='abc' or d2.DtaFileName='Sent' Timeout expired. The timeout p

我正在尝试执行此查询:

SELECT * from vwLstDtaLines d1,vwLStDtafiles d2 where d1.DtaLinePaymentDate='1/1/2000'or d1.DtaLinePaymentDate='1/1/2012'  or d1.DtaLineUserCre='abc' or d1.DtaLineUserMatch='abc' or d2.DtaFileName='Sent'



Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

反复出现此错误

您可以在
字符串连接中增加
连接超时

注:默认值为15秒

调整样本

<add name="ConnectionString" connectionString="Data Source=;Initial Catalog=;Persist Security Info=True;User ID=;Password=;Connect Timeout=200" providerName="System.Data.SqlClient"/>
</connectionStrings>

您可以在
字符串连接中增加
连接超时时间

注:默认值为15秒

调整样本

<add name="ConnectionString" connectionString="Data Source=;Initial Catalog=;Persist Security Info=True;User ID=;Password=;Connect Timeout=200" providerName="System.Data.SqlClient"/>
</connectionStrings>

好吧,看看您的SQL,在我看来,您创建的结果集比预期的要大得多

SELECT * 
from vwLstDtaLines d1,vwLStDtafiles d2 
where d1.DtaLinePaymentDate='1/1/2000' or 
d1.DtaLinePaymentDate='1/1/2012'  or 
d1.DtaLineUserCre='abc' or 
d1.DtaLineUserMatch='abc' or 
d2.DtaFileName='Sent'  
此SQL语句在两个视图之间没有显式连接。因此,您得到的结果集的大小可能类似于d1r*d2r,其中d1r是d1中的行数,d2r是d2中的行数

我会开始看那里。在SQL server中运行以下查询以查找:

SELECT COUNT(*)
from vwLstDtaLines d1,vwLStDtafiles d2 
where d1.DtaLinePaymentDate='1/1/2000' or 
d1.DtaLinePaymentDate='1/1/2012'  or 
d1.DtaLineUserCre='abc' or 
d1.DtaLineUserMatch='abc' or 
d2.DtaFileName='Sent'  

如果行数是天文数字,那么您就有一个连接问题。

好吧,看看您的SQL,在我看来,您创建的结果集比预期的要大得多

SELECT * 
from vwLstDtaLines d1,vwLStDtafiles d2 
where d1.DtaLinePaymentDate='1/1/2000' or 
d1.DtaLinePaymentDate='1/1/2012'  or 
d1.DtaLineUserCre='abc' or 
d1.DtaLineUserMatch='abc' or 
d2.DtaFileName='Sent'  
此SQL语句在两个视图之间没有显式连接。因此,您得到的结果集的大小可能类似于d1r*d2r,其中d1r是d1中的行数,d2r是d2中的行数

我会开始看那里。在SQL server中运行以下查询以查找:

SELECT COUNT(*)
from vwLstDtaLines d1,vwLStDtafiles d2 
where d1.DtaLinePaymentDate='1/1/2000' or 
d1.DtaLinePaymentDate='1/1/2012'  or 
d1.DtaLineUserCre='abc' or 
d1.DtaLineUserMatch='abc' or 
d2.DtaFileName='Sent'  

如果行数是天文数字,则存在连接问题。

是否确实要进行交叉连接?我要从两个视图中提取并比较数据。必须这样做:/do两个不同的视图具有相似的列。您是否可以对这两个进行
联合
(每个都有自己的
WHERE
子句)而不是联接?从SQL的角度来看,您所做的似乎根本上是错误的,这导致了超时。您确定要进行交叉连接吗?我想从两个视图中获取和比较数据。必须这样做:/do两个不同的视图具有相似的列。您是否可以对这两个进行
联合
(每个都有自己的
WHERE
子句)而不是联接?从SQL的角度来看,您所做的似乎根本上是错误的-这导致了您的超时。它仍然会给出相同的错误:/您可以定义会话asp.net的超时,因为您的asp.net会话超时,尝试……我认为我的查询有一些问题尝试了这种方法也没有工作相同的错误它仍然给出相同的错误:/n您可以定义会话asp.net的超时,因为您的asp.net会话超时,尝试……我认为我的查询有一些问题,尝试了这种方法也没有遇到同样的错误