I assign the checkbox each row with specific values from field "pid" retrieved from database. Then when submit button is clicked. I loop through each row to check if checkbox is selected. If selected, then update the table where pid = pid from checkbox value. But somehow my code not working :P Please help:
<asp:TemplateColumn Visible="False" HeaderText="PeoplewiseID">
								<asp:Label ID="lblPeoplewiseID" Text='<%# DataBinder.Eval(Container.DataItem, "Peoplewise_ID") %>' Runat="server" />
the code behind....
Public Sub UpdatePayment(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim update As New EventDetailBO
        Dim dgItem As DataGridItem
        Dim chkSelected As CheckBox
        Dim pplwiseID As Integer
        Dim strPID As String
        For Each dgItem In dgNotPaid.Items
            chkSelected = dgItem.FindControl("chkPayment")
            If chkSelected.Checked Then
                strPID = CType(dgItem.FindControl("lblPeoplewiseID"), Label).Text
                pplwiseID = pplwiseID.Parse(strPID)
                'pplwiseID = (CType(dgItem.FindControl("chkPayment"), CheckBox).Checked) * -1
                lblSelected.Text += pplwiseID.ToString()
                lblSelected.Text += "<br>"
            End If

    End Sub
The update statement...not sure if it's correct, the "sp_updatePayment" is a stored procedure:
Public Function updatePay(ByVal pplwise As Integer) As Integer
        Dim strpplwise As String
        Dim strConn As String = "workstation id=MYD525MG1S;packet size=4096;user id=sa;data source=MYD225MG1S;pers" & _
                        "ist security info=False;initial catalog=ems"
        Dim conn As New SqlConnection(strConn)
        Dim pplwiseID As New SqlParameter("@pplwsID", SqlDbType.Int)
        pplwiseID.Direction = ParameterDirection.Input
        pplwiseID.Value = pplwise
        Dim objCmd As SqlCommand = New SqlCommand("sp_updatePayment", conn)
        objCmd.CommandType = CommandType.StoredProcedure
        Return pplwise
    End Function