I'm trying to find a value a value within a data table based on a record I'm reading from another table.
For example, I have a number called "PCS Visit" in my first table. While looping through the records in that table, I throw the data into a datagridview. One of the values I need is in another table though.
To get the other value, I'm trying to say "go find the row in table 2 where the PCS visit number = the current record's PCS Visit Number". When you find it, bring back the "AdmitBed" associated with the PCS Visit Number in table 2.
My FoundRow = dsNRCPicker row seems to work, I just don't know how to get the value for AdmitBed from the row it found.
For example, I have a number called "PCS Visit" in my first table. While looping through the records in that table, I throw the data into a datagridview. One of the values I need is in another table though.
To get the other value, I'm trying to say "go find the row in table 2 where the PCS visit number = the current record's PCS Visit Number". When you find it, bring back the "AdmitBed" associated with the PCS Visit Number in table 2.
My FoundRow = dsNRCPicker row seems to work, I just don't know how to get the value for AdmitBed from the row it found.
Code:
Dim FoundRow() As Data.DataRow
FoundRow = dsNRCPicker.Tables("dtAdmitBed").Select("PCS_Visit = " & DataReader.Item("PCS_Visit"))
anyRow("AdmitBed") = FoundRow :(