Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If Page.IsPostBack Then
lbId = CType(GridView1.FooterRow.FindControl("lblEmpId"), Label)
tb1 = CType(GridView1.FooterRow.FindControl("txtFName"), TextBox)
tb2 = CType(GridView1.FooterRow.FindControl("txtLName"), TextBox)
chk = CType(GridView1.FooterRow.FindControl("chkIsVendor"), CheckBox)
End If
End Sub
Protected Sub GridView1_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
'Dim EC As Integer = GridView1.Rows(e.RowIndex).Cells(0).Text
Dim cmd As New SqlCommand("DELETE from mstEmployee where EmpCode=" & lbId.Text & " ", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
cmd.ExecuteNonQuery()
con.Close()
DisplayData()
End Sub