I have a big issue that one of my sites is failing to load most times. Unfortunately i cannot upload pictures yet. The problem states the following
The time out period elapsed prior to obtaining a connection from the pool. This may have occured because all pooled connections where in use and max pool size was reached.
And i get a highlighted Line 14: upcmd.Connection.Open(). The error continues further.
I am not an expert at all so what i did so far from researching around what to add the Max Pool Size in <add name="ConnectionString" connectionString="Data Source=yianniscy.db.7015338.hostedresource.com;initial catalog=xxxxxxx;User id=xxxxxx;Password=xxxxxxx;**Max Pool Size=100**" />
in webconfig
The problem still remains although this application is used by a single person and never had this issue before. This started as soon as my hosting provider did an upgrade. At the moment i understand that connections remain open and need to be closed. The problem is that i have no idea what to put and where to put it. If someone can guide me where exactly and what exactly to put i would appreciate it.
Partial Class Default2
Inherits System.Web.UI.Page
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Using upcmd As New SqlCommand("SELECT login FROM Xuser_tab WHERE name=@logname", conn)
upcmd.Parameters.Add(New SqlParameter("@Login_name", TextBox1.Text))
upcmd.Connection.Open()
Dim password_temp As String
Try
Dim dr As SqlDataReader = upcmd.ExecuteReader()
If dr.Read Then
password_temp = dr.Item(0)
If password_temp = TextBox2.Text Then
Response.Redirect("~/Controlpanel.aspx")
Else
End If
Image2.Visible = True
Label1.Visible = True
End If