Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

BEGIN TRANSACTION, COMMIT TRANSACTION AND ROLLBACK IN C# WINFORM

$
0
0

I am creating an invoice which involves many stored procedures  that I do not know how to put together and therefore I need to do some sort of begin commit and rollback in my c# code since I don't see a way to do it in sql server.

this is how I will be saving it

1. I generate an invoice #

2. I save an invoice header using the invoice #

3. Then I save the invoice details 

I made a foreach loop and I loop through each row in the invoice and save it into the invoice detail database and within the same stored procedure I update the inventory based on the items in the invoice. Here I am going into the same procedure over and over until all the rows in the invoice are used up.

so I thought to somehow put a begin and commit around step 2 and 3.

Can anyone help me or does anyone have a better idea for me (maybe there is an answer in table value parameters)?


Debra has a question


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>