0
我通過LINQ將特定列值加載到列表中,我想要獲取這些值的特定實例。這是我的頁面加載代碼。從Entitiy列表中獲取特定值
Public Sub CheckRO_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim dc As New DataWorldDataContext.DataWorldDataContext
Dim nonMatchingDealerID As New List(Of DataWorldDataContext.seanRFMatchTest)
nonMatchingDealerID = (From z In dc.seanRFMatchTests Select z).ToList
For Each item In nonMatchingDealerID
ListBox1.Items.Add(item.ContractDealerID & " " & item.ServiceDealerID & " " & item.intRepairFacilCode & " " & item.chrPgmCode & " " & item.chrRONum & " " & item.chvFacilityName)
Next
End Sub
在ListBox的selectedIndexChange,我想給item.ContractDealerID值應用到一個文本框。
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
TextBox1.Text = ListBox1.SelectedValue.?????????????
End Sub