超时已过期.从池中获取连接之前已经经过了超时时间.之所以会发生这种情况,是因为所有池化连接都在使用中,并且达到了最大池大小. [英] "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."

查看:65
本文介绍了超时已过期.从池中获取连接之前已经经过了超时时间.之所以会发生这种情况,是因为所有池化连接都在使用中,并且达到了最大池大小.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

namespace My_Project
{
    public abstract class global
    {





            public static SqlConnection conn()
            {

                SqlConnection cn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename='D:\My_Project\My_Project\DATABASE\Soneri_Bank_loan_system.mdf';Integrated Security=True;Connect Timeout=0; Max Pool Size = 100; User Instance=True");

                try
                {
                    cn.Open();
                }
                catch (Exception e1)
                {
                    MessageBox.Show(e1.Message);
                }
                return cn;
            }
        }

推荐答案

该线程可能会对您有所帮助
超时已过期.从池中获取连接之前已过超时时间...... [ ^ ]
This thread might help you
Timeout expired.The timeout period elapsed prior to obtaining a connection from the pool...........[^]


此处是仅针对同一问题/错误撰写的文章:

ASP.NET-如何使用(打开/关闭)正确连接 [ ^ ]

仔细研究一下,您将了解为什么一定会出现此错误.
Here is an article that is written for the same issue/error only:

ASP.NET - How To Use(Open/Close) Connections Correctly[^]

Go through this and you will get an idea of why this error must be coming.


这篇关于超时已过期.从池中获取连接之前已经经过了超时时间.之所以会发生这种情况,是因为所有池化连接都在使用中,并且达到了最大池大小.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆