General information
Category:
The Mere Mortals .NET Framework
Environment versions
Network:
Windows 2008 Server
>hi
>I have been told I must call Dispose on my business objects and close the connection, how do I do this? or why should I not do this?
>thanks once again
Please take this with the caveat that I know nothing about Mere Mortals. I can tell you, though, that in C# any class that implements the IDisposable interface -- which MM bizobjs apparently do -- is expected to provide and call a Dispose() method. Implementing IDisposable is an implicit statement that there is something that needs to be disposed. Holding a scarce resource like a database connection would be a typical example of when you would want to do this, rather than waiting for C#'s automatic garbage collection to kick in. When you are done with your bizobj, simply call this.Dispose(). The Dispose method should check for a valid connection and close it if found. If you are managing any other resources, release them, too. HTH....
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only