Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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;
            }
        }
Posted 24-Nov-12 0:06am
Comments
Nelek at 24-Nov-12 5:18am
   
And the question is...?
Please don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.
zeshanazam at 24-Nov-12 5:33am
   
connection string is above, got an error on form load "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."
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
zeshanazam at 25-Nov-12 3:23am
   
Same problem exists.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
zeshanazam at 25-Nov-12 3:33am
   
Same problem exists.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 299
1 Maciej Los 295
2 Sergey Alexandrovich Kryukov 205
3 Aajmot Sk 202
4 Sinisa Hajnal 166
0 OriginalGriff 7,760
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,785


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 24 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100