If True Then Dim connection As OleDbConnection Try connection = New OleDbConnection(connectionACCESS(bdd)) ' code d'utilisation ... Finally If connection IsNot Nothing Then DirectCast(connection, IDisposable).Dispose() End If End Try End If
{ OleDbConnection connection; try { connection = new OleDbConnection(connectionACCESS(bdd)); // code d'utilisation ... } finally { if (connection != null) ((IDisposable)connection).Dispose(); } }