-
Book Overview & Buying
-
Table Of Contents
Microsoft Windows Workflow Foundation 4.0 Cookbook
By :
In this task, we will create a workflow with TransactionScope
activity, in which a customized activity will insert some data in the database. If any exception/error occurs, the newly inserted data will be rolled back.
Create a Workflow Console Application:
Create a new Workflow Console Application and name it UseTransactionScope.
Create a database for testing:
Create a new database in SQL Server (or SQL Server Express) and name it TransactionDB. Use the following SQL statement to create a new table:
create table UserTable( UserID nvarchar(50) primary key )
Add references to the project:
Add a reference to the System.Tranactions namespace because we are going to use IsolationLevel
enumeration in our code.
Create
InsertDataToDBActivity
code:
Add a new class file to the project and name it InsertDataToDBActivity.cs. By using this activity, we can insert a row of data into the database that has been created in advance...
Change the font size
Change margin width
Change background colour