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 Dnyaneshwar@Pune 719
1 CHill60 240
2 Sergey Alexandrovich Kryukov 220
3 TheRealSteveJudge 220
4 CPallini 200
0 Sergey Alexandrovich Kryukov 9,078
1 OriginalGriff 6,771
2 Peter Leow 4,282
3 Zoltán Zörgő 3,809
4 Richard MacCutchan 2,661


Advertise | Privacy | Mobile
Web01 | 2.8.150128.1 | Last Updated 24 Nov 2012
Copyright © CodeProject, 1999-2015
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