How to close the connection after set Transation to Nothing or Commit/Rollback

Posted by user1957271 on Stack Overflow See other posts from Stack Overflow or by user1957271
Published on 2013-07-03T05:02:29Z Indexed on 2013/07/03 5:05 UTC
Read the original article Hit count: 134

Filed under:

I develop the DAL class for db operation

 Public Sub StartTransaction()
    Dim objConnection As SqlConnection = EstablishConnection()
    objConnection.Open()
    Me.Transaction = objConnection.BeginTransaction()
End Sub

Public Sub CommitTransaction()
    Me.Transaction.Commit()
End Sub

Public Sub RollBackTransaction()
    Me.Transaction.Rollback()
End Sub

after start the transaction when we commit or rollback and set transaction object to nothing it dont close the connection attach with this transaction how I close the Connection attach to this transaction???

© Stack Overflow or respective owner

Related posts about vb.net