I have three calenders that display booked dates for the span of 3 months. When I try to connect to database (sql server), I encountered this error;
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.
My code:
Protected Sub bookSchedule3_DayRender(sender As Object, e As DayRenderEventArgs) Handles bookSchedule3.DayRender
strSQL = "SELECT bookDate FROM booking"
Call runQ(strSQL)
Dim dschkDate As New DataSet
dschkDate.Clear()
sqlAdap.Fill(dschkDate, "booking")
If e.Day.Date.CompareTo(Convert.ToDateTime(dschkDate.Tables(0).Rows(0).Item("bookDate").ToString.Trim)) = 0 Then
e.Day.IsSelectable = False
e.Cell.BackColor = System.Drawing.Color.Transparent
e.Cell.ForeColor = System.Drawing.Color.Transparent
End If
End Sub
I tried adding max pool but it didn't fix the error. I hope there is a way to solve this and am willing to learn other ways if necessary.