myQuery = "select Id,UserName,Class from Operator order by Id"
If myclsDB.DB(myQuery) = False Then
Exit Sub
Else
For i = 0 To myclsDB.dataset.Tables(0).Rows.Count - 1
With myclsDB.dataset.Tables(0)
stritem = .Rows(i).Item(0)
item = New ListViewItem(stritem)
subitem1 = New ListViewItem.ListViewSubItem(item, .Rows(i).Item(0))
subitem2 = New ListViewItem.ListViewSubItem(item, .Rows(i).Item(1))
subitem3 = New ListViewItem.ListViewSubItem(item, .Rows(i).Item(2))
item.SubItems.Add(subitem1)
item.SubItems.Add(subitem2)
item.SubItems.Add(subitem3)
lsvResult.Items.Add(item)
End With
Next
End If
但是显示的数据有点问题啊!!
比如 要显示下面的数据时
ID UserName Class
1 tt 3
它会这样显示啊!
ID UserName Class
1 1 tt