DataTable: как получить значение элемента с именем строки и столбца? (VB)
У меня простойDataTable
где один из столбцов содержит уникальные значения. Например:
ColumnName1 ColumnName2
value1 35
value2 44
value3 10
Поскольку я знаю, что значения 1, 2 и 3 всегда будут отличаться друг от друга, я хотел бы получить значение этой таблицы, используя толькоColumnName2 а такжеone of the values of ColumnName1. That would for example be:
searchedValue = DataTable.Rows("value3").Item("ColumnName2)
'result would be 10
Я попытался следующие примеры безуспешно:
with the DataTable.Select method: returns an array of rows, but I only need one
with the DataTable.Rows.IndexOf method: if I understood well, I need to provide the whole row contents for it to be found with this method.