connection pooling problems with sqlconnection object

  • Thread starter Thread starter Peter Row
  • Start date Start date
P

Peter Row

Hi,

I have the following code that gets run in my database wrapper class.

If Not (m_conn Is Nothing) Then
If m_conn.state = ConnectionState.Open Then
m_conn.Close()
End IF

m_conn = Nothing
End If

I get the following error on the m_conn.Close() line:

An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll

Additional information: A connection pooling error has occurred.

The IF has already checked that the connection is open so why the hell is it
saying the operation is invalid?

It typically seems to produce this error after doing a couple of debug runs
of the app.

Regards,
Peter
 
First, trap the exception to see what's going on (in detail) and show us.

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top