标题:超时时间已到
只看楼主
水晶心
Rank: 1
等 级:新手上路
帖 子:69
专家分:0
注 册:2010-7-27
结帖率:80%
 问题点数:0 回复次数:1 
超时时间已到
网站在服务器上运行,出现了“超时时间已到,但尚未从池中获取连接,出现这种情况可能是因为所有池均在使用,并且达到了最大池大小。,怎么解决啊。
namespace Management.DAL
{
    public static class DBHelper
    {

        private static SqlConnection connection;
        public static SqlConnection Connection
        {
            get
            {
                string connectionString = "Data Source=.;Initial Catalog=kq;Integrated Security=True"; //ConfigurationManager.ConnectionStrings["MyOfficeConnectionString"].ConnectionString;
                connection = new SqlConnection(connectionString);
                if (connection == null)
                {                    
                    connection.Open();
                }
                else if (connection.State == System.Data.ConnectionState.Closed)
                {
                    connection.Open();
                }
                else if (connection.State == System.Data.ConnectionState.Broken)
                {
                    connection.Close();
                    connection.Open();
                }
                return connection;
            }
        }

应该怎么修改啊。
搜索更多相关主题的帖子: 超时 时间 
2010-10-15 10:44
水晶心
Rank: 1
等 级:新手上路
帖 子:69
专家分:0
注 册:2010-7-27
得分:0 
<configuration>
    <appSettings/>
    <connectionStrings>
  <add name="kqConnectionString1" connectionString="Data Source=.;Initial Catalog=kq;Integrated Security=True;MultipleActiveResultSets=False;Packet Size=4096;Application Name=&quot;Microsoft SQL Server Management Studio&quot;"
   providerName="System.Data.SqlClient" />
 </connectionStrings>
    <system.web>

web.config文件怎么修改啊,
2010-10-15 10:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-322957-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.376175 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved