I'm using Entity Framework with stored procedures for inserting/updating/deleting entities.
The task that I'm doing is inventory management with FIFO/LIFO methods => those inserts/updates/deletes perform several checks and can fail (sometimes they fail).
The problem is I want to report back to .NET what went wrong and why. How can I do it?
Currently I'm using something like this:
BEGIN --rollback
ROLLBACK TRAN
RAISERROR (N'There''s not enough items in stock.', -- message
16, -- severity
1) -- state
END;
I always get "MSDTC error" - "The underlying provider failed on EnlistTransaction."
I don't think it is getting that far. It is erroring out when one of the transactions is starting up, your custom error is not getting raised.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With