D
Daniel Bello Urizarri
Hello:
I'n havig problems with an exception generated on a finalize method while
trying to Close(); a OleDbConnection.
While in the Close method documentation can be readed:
"CAUTION Do not call Close or Dispose on a Connection, a DataReader, or
any other managed object in the Finalize method of your class. In a
finalizer, you should only release unmanaged resources that your class owns
directly. If your class does not own any unmanaged resources, do not include
a Finalize method in your class definition. For more information, see
Programming for Garbage Collection."
The "about OleDbConnection class" documentation says:
If the OleDbConnection goes out of scope, it is not closed. Therefore, you
must explicitly close the connection by calling Close or Dispose.
Is the destruction of an object instance an "out of scope" situation?
What to to do? Shoudl I see "Programming for Garbage Collection"?
I'n havig problems with an exception generated on a finalize method while
trying to Close(); a OleDbConnection.
While in the Close method documentation can be readed:
"CAUTION Do not call Close or Dispose on a Connection, a DataReader, or
any other managed object in the Finalize method of your class. In a
finalizer, you should only release unmanaged resources that your class owns
directly. If your class does not own any unmanaged resources, do not include
a Finalize method in your class definition. For more information, see
Programming for Garbage Collection."
The "about OleDbConnection class" documentation says:
If the OleDbConnection goes out of scope, it is not closed. Therefore, you
must explicitly close the connection by calling Close or Dispose.
Is the destruction of an object instance an "out of scope" situation?
What to to do? Shoudl I see "Programming for Garbage Collection"?