Adds a data column to a specified data table.
Column - The data column object added to data table. If this property is set, all of the properties under the Options category are ignored.
ColumnName - The name of the column to be added.
DataTable - The data table object to which the column would be added.
AllowDBNull - Defines whether new values are allowed in the new column for rows that belong to the table.
AutoIncrement - Defines if the value of the column increments automatically when a new row is added.
DefaultValue - Defines the default value for the new column when the new column is added.
MaxLength - Specifies the maximum length.
Unique - Defines that the values of the new column must be unique.
ContinueOnError - The Boolean value to specify whether to continue executing the next activities even if there is an error thrown on this activity.
DisplayName - Renames the activity.
- Create a DataTable variable called dt.
- Add a Generate Data Table inside the initial Sequence.
- In the Generate DataTable Data Table field under Properties, add the dt variable.
- In the ColumnSeparators field under Properties, write ";", and in the NewLineSeparator field, write "|".
- In the Generate Data Table Input field, type "1; Nicole|2; John|3; Michael". This would be the sample values inside the data table.
- Add an Add Data Column activity.
- In the Add Data Column DataTable field, add the dt variable.
- In the Add Data Column Column Name field, write "Age".
The use case should look as the following screenshot:
Initially, the DataTable should only have 2 columns, but after execution, a column named Age should be added.