Posted on: 10/12/2014 7:24:32 AM | Views : 426

Hello user.
I need to make an invoice software.
An invoice has diferent line for the article,price,etc I call it Details
So i have a list of lines in my object Invoice.
My problem is how can i do to insert this line in the DB and the invoice in the database. 
1.- If one line is not insert in the database for any problem i need rollback all lines inserted and the invoice.
2.- if the invoice is inserted but not the lines, i need rollback the invoice.
i was using 2 hashtable(1 for invoice, 1 for details) to do this, but i found the problem if something happend, the rollback do not deleted the other inserted.
here is my code:
Dim ht As New Hashtable 'Here are the data for the invoice, client info,date,status ht.Add("@Estado", oInvoice.Estado) '0 Emitida ht.Add("@FechaEmision", DateTime.Parse(oInvoice.Fecha_Emision)) ...

Go to the complete details ...