IBM Database Add-Ins for Visual Studio  

Creating IBM Database Activities in Sequential Workflows

If you are using Windows® Workflow Foundation (WF) to create graphical sequential workflow applications, you can add IBM database activities to your workflows. IBM database activities are available for any IBM data server to which you have established a connection.

Prerequisites:

To create an IBM database activity in a sequential workflow:

  1. With your sequential workflow open in the visual designer, drag the IBMDatabase activity from the Toolbox to the workflow design surface.
  2. Copy and paste the connection string from your IBM data connection to the IBM database activity.
    1. In the Server Explorer click your data connection, and then press F4.
    2. In the Properties window, copy the value for the ConnectionString property.
    3. On the design workflow surface, click the IBM database activity.
    4. In the Properties window, paste the copied string in the value cell of the ConnectionString property.
  3. In the CommandType property list, select the type of command that you want to generate.
    • Text - to type an SQL statement that you want to run
    • StoredProcedure - to select a procedure that you want to run
    • TableDirect - to select a table that you want to query
  4. Specify information for the CommandText property, based on the command type that you select.
    • Text - type the SQL statement to run.
    • StoredProcedure - select the procedure to run.

      If the procedure that you select has IN or INOUT parameters, a property is added to the Properties window for each such parameter. Specify a value for each of these parameters.

    • TableDirect - select the source table to query.
  5. Optional: To define an event that must occur before the IBM database activity execute command, specify the event name in the CommandExecuting property, and then press Enter to generate the event code.
  6. Optional: To define an event that must occur after the IBM database activity execute command, specify the event name in the CommandExecuted property, and then press Enter to generate the event code.

    Define this event if you want to debug the IBM database activity.

  7. To see the result from the IBM database activity, press F5 to run the workflow.
  8. To debug the IBM database activity, set a line breakpoint in the code of the CommandExecuted event that you defined, and then press F5. When the debugger stops at the breakpoint, review the dataset of the IBM database activity.

See Also

Using Visual Studio 2008 Technology in IBM Database Add-Ins for Visual Studio


.NET Development Forum   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.