Hi,
usually to update every row with a normal index I would use:
int rowCount = protocol.RowCount(100);
for (int i = 1; i < rowCount + 1; i++)
{
}
But my problem now is I have a table with an index which is not continuous counting.
Here is a picture of the index:
index.PNG
In my case I want to update a special column for every row before I start updating, adding the rows.
But with my index I can't do a for loop, is there a possibility to user foreach?
Hi Stefan,
You can use the Element.GetTablePrimaryKeys to get the table keys.
Then you can use a foreach loop to go over all your table keys.
Element myElement = engine.FindElement("My element name");
string[] tableKeys = myElement.GetTablePrimaryKeys(100);
foreach (string primaryKey in tableKeys)
{}
Hi Stefan,
The same logic can be used in a protocol:
string[] tableKeys = protocol.GetKeys(100);
foreach (var key in tableKeys)
{
}
formatted code:
https://gist.github.com/Ivehe/b972771ec31d527609fd204ffb51bc47
Hi Ive,
working superb, many thanks!
But this is in a protocol, is there a variable like this element?