Try
cn.startUPConnection()
Using tran As SqlTransaction = cn.appConnection.BeginTransaction(IsolationLevel.ReadCommitted)
Try
If objtransMasterList.IsDirty Then
Dim objTransMaster As SQLTransMaster
For Each objTransMaster In objtransMasterList
If objTransMaster.IsNew Then
Dim cmd As New SqlCommand
cmd.CommandText = SQLInsertStoredProc
cmd.Connection = cn.appConnection
cmd.Transaction = tran
cmd.CommandType = CommandType.StoredProcedure
saveTransMasterParamsFromObj(cmd, CMDTYPES.INSERT, objTransMaster)
cmd.ExecuteNonQuery()
End If
Next
End If
tran.Commit()
Catch a As Exception
tran.Rollback()
success = False
objSQLErrorList.processError(a)
unLockIt()
GoTo finally_Renamed
End Try
End Using
Catch b As Exception
success = False
objSQLErrorList.processError(b)
unLockIt()
Finally
If Not cn.appConnection Is Nothing Then
If cn.appConnection.State <> ConnectionState.Closed Then cn.CloseConnection()
End If
End Try
|