不太熟悉VB6.0,.net可以在设计时直接将ListView的CheckBoses属性设为True Dim cmdstr As String Dim lvi As ListViewItem For Each lvi In ListView1.Items If lvi.Checked = True Then cmdstr = "insert into mytable values('" & lvi.SubItems(0).Text & "','" & lvi.SubItems(1).Text & "','" & lvi.SubItems(2).Text & "',)" End If Next
Dim cmdstr As String
Dim lvi As ListViewItem
For Each lvi In ListView1.Items
If lvi.Checked = True Then
cmdstr = "insert into mytable values('" & lvi.SubItems(0).Text & "','" & lvi.SubItems(1).Text & "','" & lvi.SubItems(2).Text & "',)"
End If
Next
我是想实现这样的功能:
1.显示数据库里的试题表,表里有各个字段(科目,题型,内容等)
2.可任意选多条试题,然后再把这些试题依次加入到另一张新的数据库表中.