For i As Integer = 0 To Me.checkedlistbox1.CheckedItems.Count - 1
QRY= insert into products (customerid,productid)" _
& " values (" & id.Text & ", '" & checkedlistbox1.CheckedItems.Item(i)("productid") & "')"
next
by using above i get
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
all the selected values are stored correctly as nnned but after the last product inserted i get the above error