Transaction aborted exception in VB.NET

Tags:
VB.NET
Private Function CreatePrescritionDetails(ByVal PrescriptionObject As Prescription, ByVal PrescriptionHeaderID As Int64) As Boolean
Try
Dim _PrescriptionDBObject As PrescriptionDB
_PrescriptionDBObject = New PrescriptionDB

Dim TransactionScopeObject As TransactionScope = New TransactionScope'
The debug stops here and throw the errors.
Using TransactionScopeObject
For Each _PrescriptionDetailObject As PrescriptionDetail In PrescriptionObject.PrescriptionDetailsList
Dim _PrescriptionDetailID As Int64
_PrescriptionDetailID = _PrescriptionDBObject.CreatePrescritionDetails(_PrescriptionDetailObject, PrescriptionHeaderID)
_PrescriptionDetailObject.ID = _PrescriptionDetailID
If _PrescriptionDetailID <> 0 Then
If _PrescriptionDetailObject.PrescriptionDrugTapperingList.Count > 0 Then
If CreateDrugTaperingDetails(_PrescriptionDetailObject.PrescriptionDrugTapperingList, _PrescriptionDetailID) = False Then
Return False
End If
End If
End If
Next
TransactionScopeObject.Complete()
End Using

Return True
Catch ex As Exception
Throw
End Try
End Function
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: