niger007
asked on
System.InvalidOperationException occured in system.dll
Hi Foks,
My vb.net application requires sql connection to exceute some tasks. I am experiencing the below error message intermittently.. and here is my connection code.
Imports System.Data.SqlClient
Public Class SqlHelper
Public Function GetConnection() As SqlConnection
Dim cn As New SqlConnection
With cn
.ConnectionString = "Data Source = .;Initial Catalog=xxxxxxx;Integrated security=SSPI"
.Open()
End With
Return cn
End Function
End Class
The detailed exception message is
System.InvalidOperationExc eption occured in System.data.dll
Additional Information: Time out 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.
How should i get rid of this situation ????
My vb.net application requires sql connection to exceute some tasks. I am experiencing the below error message intermittently.. and here is my connection code.
Imports System.Data.SqlClient
Public Class SqlHelper
Public Function GetConnection() As SqlConnection
Dim cn As New SqlConnection
With cn
.ConnectionString = "Data Source = .;Initial Catalog=xxxxxxx;Integrated
.Open()
End With
Return cn
End Function
End Class
The detailed exception message is
System.InvalidOperationExc
Additional Information: Time out 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.
How should i get rid of this situation ????
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Public Class SqlHelper
Public Function GetConnection() As SqlConnection
Dim cn As New SqlConnection
With cn
.ConnectionString = "Data Source = .;Initial Catalog=xxxxxxx;Integrated
.ConnectionTimeout = 0
.Open()
End With
Return cn
End Function
End Class