程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SqlServer數據庫 >> 關於SqlServer >> SQL Server 2000 SP4與數據鏈接池問題

SQL Server 2000 SP4與數據鏈接池問題

編輯:關於SqlServer

今天遠程連接一台xp sp2上的SQL,報錯信息如下:

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
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.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Source Error:
Line 2503: cmd.CommandType = CommandType.StoredProcedure;
Line 2504:
Line 2505: connection.Open();
Line 2506: SqlCommandBuilder.DeriveParameters(cmd);
Line 2507: connection.Close();

但是,我的連接字符串中已經設置了,最大鏈接池=200,應該是不可能全部被占用的。

當把鏈接池設置去掉,就報:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
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.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Source Error:
Line 2503: cmd.CommandType = CommandType.StoredProcedure;
Line 2504:
Line 2505: connection.Open();
Line 2506: SqlCommandBuilder.DeriveParameters(cmd);
Line 2507: connection.Close();

這下子,問題就明朗了,典型的沒有打 Sql2000 sp4 的問題,打上sp4問題解決,差點被誤導。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved