Calls a public method of a specified object or type.
DisplayName - Renames the activity.
GenericTypeArguments - Collection
MethodName - The name of the method to be called when the activity executes.
Parameters - The parameter collection of the called method.
Result - The return value of the method call.
RunAsynchronously - Specifies whether the method is called asynchronously. The default value is False.
TargetObject - The object that contains the method to call.
TargetType - The type of TargetObject.
- Create a DataSet variable called ds, and a DataTable variable called dt.
- Add an Assign activity inside a Sequence.
- In the To field, write ds, and in the Value field, write new DataSet().
- Add another Assign activity.
- In the To field, write dt, and in the Value field, write new DataTable("Sample Table Name").
- Add a Generate Data Table activity, and in DataTable field under Properties, add dt.
- In the ColumnSeparators field, type ";", and in the NewLineSeparator, write "|".
- In the Input field, write "1; Nicole|2; John" (or whatever values you prefer).
- Add an InvokeMethod activity.
- In the Parameters under Properties, add an Argument.
- Set the Value of the argument to dt and its Type to DataTable, and then Click OK.
- In the TargetObject field, type ds.Tables.
- In the MethodName, write Add.
- Add a Write Line activity.
- In the Text field, write ds.Tables(0).rows.Count.ToString().
The use case should look as the following screenshot:
After generating a Data Table, it is added into the ds variable by using InvokeMethod, and then the rows count of the first Data Table in the DataSet is displayed using Write Line. The output should look like this in the Output panel: