I’m using the build data table activity and need to output a table with multiple keys. It doesn’t look like this can be done with the build data table activity alone. Does anyone know how to achieve this?
Silviu or @tdhaene Can you explain how I would use your solution for setting primary keys to set only some fields as keys?
Hi,
First add a key like:
YourDatatable.PrimaryKey = new DataColumn() { yourDatatable.Columns(“id”) };
Next do invoke method AcceptChanges
add_primaryKey.xaml (7.4 KB)
@bcarp Here you have the snippet
if you use named columpns or multiple values: use new datacolumn() {dt.Columns(“Column0”),dt.Columns(“Column1”)} as the value.
If this helps don’t forget to mark sthis as solution so other users can retrieve the solution
kind regards,
Tom
I’m still getting errors as to the method. I’ve tried dt.columns and dt as the target object along with AcceptChanges and ApplyChanges. Please see attached.
It seems to me that your variable is not of the type datatable but datacolumncollection.
In my posted example you can find the proper types
I see that the " sign for the first column (edc) is not a correct one. paste the value in notepad to correct the correct char. @bcarp