Set PrimaryKey on datatable - in order to use .find
Hi,
I have a datatable set up and I want to use the .find method to look up a particular row.
The find method takes a value and applies it to the primaryKey column.
You first need to assign a primaryKey column by passing in an array of DataColumn objects to the datatable.PrimaryKey method.
So I have created a variable array of type DataColumn (arrDataColumns) but when i try to assign a column to the array it refuses to assign!
my assign activity looks like this:
arrDataColumns(0) = mydatatable.Columns(0)
(which is where it fails with an 'object reference not set to an instance of an object' error.
but i would go on to another assign activity to set the primary key like this:
myDataTable.PrimaryKey = arrDataColumns
can anyone help?
Ni ck
-
Mark,
I am interested in the workflow you posted, as I am trying to learn how to manipulate datatables and specifically add datarows. It appears that this is only a partial workflow? Would you mind posting the complete workflow if you still have this available?
Thanks so much!0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar