Protected Sub btnok_Click(sender As Object, e As EventArgs) Handles btnok.Click
' Call check()
Dim chk As CheckBox
Dim lblgmid As Label
Dim i As Integer
For i = 0 To myRepeater.Items.Count - 1
chk = myRepeater.Items(i).FindControl("chk")
lblgmid = myRepeater.Items(i).FindControl("lblgmid")
If chk.Checked = True Then
If con.State = ConnectionState.Open Then
str = "insert into Login(agent_gmid,agent_date,agent_time) " & _
"values('" & lblgmid.Text & "', '" & lbldate.Text & "', '" & lbltime.Text & "')"
cmd = New SqlClient.SqlCommand
With cmd
.Connection = con
.CommandType = CommandType.Text
.CommandText = str
.Parameters.AddWithValue("@gmid", lblgmid.Text())
.Parameters.AddWithValue("@date", lbldate.Text())
.Parameters.AddWithValue("@time", lbltime.Text())
cmd.ExecuteNonQuery()
End With
End If
End If
Next
End Sub