当我将鼠标悬停在另一个Listview中的项目上时,如何在ListView上显示数据?

时间:2014-05-22 04:45:33

标签: mysql vb.net listview

所以我有这个代码但是没有用。数据来自MySQL数据库。有人请帮忙。 :)

ListView1.Items.Clear()
Dim list As New ListViewItem
command.CommandText = "SELECT Quantity, Unit, Product FROM tblPurchase_Products WHERE PO_Number = '" & CInt(***WHAT SHOULD I WRITE HERE?!***) & "' "
adapter.SelectCommand = command
reader = command.ExecuteReader()
While reader.Read
    list = ListView1.Items.Add(reader.GetString(0))
    list.SubItems.Add(reader.GetString(1))
    list.SubItems.Add(reader.GetString(2))
End While
reader.Close()

2 个答案:

答案 0 :(得分:0)

您可以使用ListView 1_ItemMouseHover事件在另一个列表视图中显示数据

 Private Sub ListView1_ItemMouseHover(sender As [Object], e As ListViewItemMouseHoverEventArgs)

               your code here

 End Sub

答案 1 :(得分:0)

CInt =转换为整数类型

ex:textbox1.text = 12

command.CommandText = "SELECT Quantity, Unit, Product FROM tblPurchase_Products WHERE PO_Number = '" & CInt(textbox1.text) & "' "

结论:必须是PO_Number

如果您无法处理,请提供更多信息