Efficient way to add row to a datatable in Apps

The quickest way I found is to create a temp table with the relevant value in an app variable

BuildDataTable(
New DataTable(“TempDT”),
New DataColumn(){ New DataColumn(“Name”), New DataColumn(“Age”)},
New List(Of Object) From {
AddDataRow(New Object(){“Baishali”, “30”}),
},
True
)

and then add the datarow to the existing table by

dt.addrow(TempDT.Select.First)

Still would be nice to just do dt.addrow() or dt.rows.add({arrayString}), but the above method works for now.

1 Like