From: Jesus A. <ja...@er...> - 2003-08-04 10:54:09
|
Hi all, I am using 1.1 Alpha 2 - .NET 1.0 I have a single connection that I keep using during all the application. It is a class that creates the connection the first time it is required and in the override of the System.object.Finalize method I close the connection: ~myconnectionclass() { if (m_Connection != null) { if (m_Connection.State == ConnectionState.Open ) { m_Connection.Close(); } m_Connection = null; } } But sometimes, although the connection is not null and is ConnectionState.Open when it arrives to m_Connection.Close it throws an exception: An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll Additional information: Stream does not support writing. What am I doing wrong?? Regards, Jesus |