1
I got a stock in a file .aspx
that runs multiple Inserts in the bank. I need that if something fails, the operation is canceled, since one record will depend on the other.
I usually use a transaction function to do this in other languages/frameworks (example, PHP Laravel).
It is possible to do a transaction in C#/Webforms?
Yes, but I don’t quite understand how you perform your Inserts , they are called one by one per event ?
– Marco Souza
@Marconciliosouza is like this: I create an Insert for the table "ordem_servicos", then I have to create several records related to this "ordem_servico". I need to make sure that everything went well. Should any exception happen, I want to give a "rollback"
– Wallace Maxters
I know it’s transaction that solves this, but I don’t know how to do C#, you know? I’m starting now :p
– Wallace Maxters
in general you need to have your Insert in a Transactionscope see the question you had asked... https://answall.com/q/162465/43340
– Marco Souza