I am using the following query to pull a row from a datatable in memory.
Dim results = _
From myRow In exceldt.AsEnumerable() _
Where myRow.Field(Of String)("Serial Number") = Row.Item("Serial Number") _
Select myRow
resultrow = results.CopyToDataTable.Rows(0)
I need to get the index of the resultrow when it was part of exceldt. I can’t seem to find anything on this. Suggestions?
I don’t work in VB.net so forgive my code but you can get the index of a projection with something along the lines of this:
I can’t provide much more with in VB but this quick example does work as a Console app. You can see how the select / projection captures the index and item. You will need to incorporate similar logic before filtering (where) you initial enumeration.
results