Torna al Thread
[CODE]
#Region "IDisposable Support"
Private disposedValue As Boolean ' To detect redundant calls
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
'ConnettiCatalogo.Close()
'ConnettiCatalogo.Dispose()
'ConnettiCatalogo = Nothing
'ConnettiGenerale.Close()
'ConnettiGenerale.Dispose()
'ConnettiGenerale = Nothing
If IsNothing(Dati) = False Then
If Dati.HasRows = True Then
Dati.Close()
End If
Dati = Nothing
End If
If IsNothing(ConnettiCatalogo) = False Then
If ConnettiCatalogo.State <> Data.ConnectionState.Closed Then
ConnettiCatalogo.Close()
ConnettiCatalogo.Dispose()
ConnettiCatalogo = Nothing
Else
ConnettiCatalogo.Dispose()
ConnettiCatalogo = Nothing
End If
End If
If IsNothing(ConnettiGenerale) = False Then
If ConnettiGenerale.State <> Data.ConnectionState.Closed Then
ConnettiGenerale.Close()
ConnettiGenerale.Dispose()
ConnettiGenerale = Nothing
Else
ConnettiGenerale.Dispose()
ConnettiGenerale = Nothing
End If
End If
End If
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
[/CODE]