Dim CheckBoxList1 As CheckBoxList
Dim lblID As Label
Dim i As Integer
For i = 0 To GridView1.Rows.Count - 1
CheckBoxList1 = GridView1.Rows(i).FindControl("CheckBoxList1")
lblID = GridView1.Rows(i).FindControl("lblCheckBoxList1") If CheckBoxList1.Items(i).Selected = True Then <-----มันErrorว่า
Dim strSql3 As String = "INSERT INTO zSHIPMENTRECORDTRANS(SHIP_RKEY,INVENTTRANSID,CREATEDBY)VALUES('" & rke & "','" & Items(i) & "','" & createdby & "')"
Dim AdapstrSql3 As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(strSql3, Cnn)
AdapstrSql3.Fill(DS, "SHIPMENTRECORDTRANS")
GridView1.DataSource = DS.Tables("SHIPMENTRECORDTRANS")
GridView1.DataMember = "SHIPMENTRECORDTRANS"
GridView1.DataBind()
End If
Next
Errorว่า Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index