[WF4]Use TransactionScope Activity In Code

Create a database in SQL Server(SQL Server Express), create a table with the following sql statement:

Workflow:

InsertDataToDBActivity:

Host:

Result:

Check the database, we would find nothing written to database, because there is an exception in TransactionScope Activity. Database will rollback automatically.

blog comments powered by Disqus