How I Implement IDispoosabel Interface?

I am createing a class, through which I will interface of database. I want to use I disposable interface int it.
Who is Participating?
SteveH_UKConnect With a Mentor Commented:
Public Class MyClass Implements IDisposable

  Protected disposed As Boolean = False

  Protected Overridable Overloads Sub Dispose( _
            ByVal disposing As Boolean)
            If Not Me.disposed Then
                If disposing Then
                End If
                ' Add code here to release the unmanaged resource.
                unmanagedResource = IntPtr.Zero
                ' Note that this is not thread safe.
            End If
            Me.disposed = True
  End Sub

#Region " IDisposable Support "
        ' Do not change or add Overridable to these methods.
        ' Put cleanup code in Dispose(ByVal disposing As Boolean).
        Public Overloads Sub Dispose() Implements IDisposable.Dispose
        End Sub
        Protected Overrides Sub Finalize()
        End Sub
#End Region

End Class

This example was taken from MSDN.  See
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.