Hi,
I'm using in memory DataTable and I would check if a specific value exist in the table (using the primary key already defined) to update a record.
I have a table named Test with 2 different field: test_id and number_occurrences
Dim record_to_find(() as DataRow
record_to_find = test_table.Select("Test_id" = value_to_be_find)
if (test to check if value_to_be_find" has been found in the DataTable) then
' updating the table
record_to_find(0)("number_occurrences") = 100
Else
DO nothing
End If
this because not only value_to_be_find are present into the DataTable, before update table I should check if the select has returned a valid record, because otherwise I get an IndexOutOfRangeException error.
I tried different solution but I'm not able to execute the update only for the found record.
Thanks
Massimo
I'm using in memory DataTable and I would check if a specific value exist in the table (using the primary key already defined) to update a record.
I have a table named Test with 2 different field: test_id and number_occurrences
Dim record_to_find(() as DataRow
record_to_find = test_table.Select("Test_id" = value_to_be_find)
if (test to check if value_to_be_find" has been found in the DataTable) then
' updating the table
record_to_find(0)("number_occurrences") = 100
Else
DO nothing
End If
this because not only value_to_be_find are present into the DataTable, before update table I should check if the select has returned a valid record, because otherwise I get an IndexOutOfRangeException error.
I tried different solution but I'm not able to execute the update only for the found record.
Thanks
Massimo