我已经将检查的值存储在一个数组中,但是当只检查一项并尝试保存它时,我收到一个错误:索引超出了数组的范围,而检查 2 个或更多值将没有错误。请帮忙。
Dim count as Integer
Dim ListedItems As New ArrayList()
for count = 0 To (CLB1.Items.Count - 1)
ListItems.Add(CLB1.GetItemText(CLB1.CheckedItems(count)).ToString)
query("Insert Into accnts (accnts.IDNo, accnts.PayName) Values ('" & IDTB.Text &"','" & ListItems(count) & "')
MsgBox("Record Saved",MsgBoxStyle.OkOnly)
Next