开发者

SQL in TimeOut Expired

This SQL works in 47 second.

SELECT  B.HESAP_NO, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2 AS 'TEKLIF',B.MUS_K_ISIM,
dbo.fngcodeme(B.HESAP_NO, B.DOVIZ_KOD, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2,'20110201', '20110228') AS 'YATAN',
(CASE WHEN B.DOVIZ_KOD = 21 THEN 'EUR' WHEN B.DOVIZ_KOD = 2 THEN 'USD' WHEN B.DOVIZ_KOD = 1 THEN 'TL' END) AS 'KUR',
D.AVU开发者_如何学PythonKAT, 
(CASE WHEN D.HESAP IN (SELECT T_HESAP_NO FROM TAKIP) THEN 
(SELECT CONVERT(VARCHAR(10),ICRA_TAR,103) FROM TAKIP WHERE T_HESAP_NO = D.HESAP)
ELSE ' ' END) AS 'ICRA TARİHİ', 
(CASE WHEN D.HESAP IN (SELECT T_HESAP_NO FROM TAKIP) THEN 
(SELECT CONVERT(VARCHAR(10),HACIZ_TAR,103) FROM TAKIP WHERE T_HESAP_NO = D.HESAP)
ELSE '' END) AS 'HACİZ TARİHİ'
FROM YAZ..MARDATA.S_TEKLIF B, AVUKAT D
WHERE B.HESAP_NO = D.HESAP
AND B.KAPANIS_TAR IS NULL
AND ISNULL(dbo.fngcodeme(B.HESAP_NO, B.DOVIZ_KOD, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2,'20110201', '20110228'),0) > 0
GROUP BY B.HESAP_NO, B.TEKLIF_NO1 + '/' + B.TEKLIF_NO2,B.DOVIZ_KOD ,B.MUS_K_ISIM, D.AVUKAT, D.HESAP

And my TimeOut is Connect Timeout=20000

But i still getting this error.

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

Line 160:      myConnection.Open();
Line 161:
Line 162:      SqlDataReader dr = myCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
Line 163:
Line 164:      // show the data

Where can i doing wrong?


You have to increase the timeout in the myCommand object:

myCommand.CommandTimeout = 60000; // 1 minute, put 0 for infinite


Maybe it's not connection timeout but asp.net timeout

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜