If you are using WinForms, as I suspect, when you add an item to the listview, you should set the tag to either the entire DataRow object, or the value of the student_id column. Then, anywhere that you have a reference to the item, you can access the item s tag property to get the necessary information. For instance, something like this would work:
For Each row As DataRow In table
Dim item As ListViewItem = ListView1.Items.Add(row("student_name").ToString())
item.Tag = row(row("student_id").ToString())
Next
接着,从学生身份证和物品中获取学生身份证的代码如下:
Private Sub ListView1_ItemSelectionChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.ListViewItemSelectionChangedEventArgs) Handles ListView1.ItemSelectionChanged
Dim studentId As String = CType(e.Item.Tag, String)
End Sub