Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
i am editing records from grid view with help of edit button ,the button is on grid view ,but it not editing the records to another form plz help me it is very argent my code is given below



VB
Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick


        Dim db = New dbattendanceEntities3
        If e.ColumnIndex = 0 Then
            Dim i = e.RowIndex


            Dim emp = db.Employees.FirstOrDefault(Function(o) o.emp_id = i)




            If emp IsNot Nothing Then
                With emp

                    txtName.Text = .Name
                    txtFatherName.Text = .FatherName
                    txtEmail.Text = .Email

                End With
            End If
        End If


    End Sub

End Class
Posted
Comments
Kschuler 31-Jul-13 12:17pm    
Can you supply more information? The code you have there is nice, but we dont' know what emp is....we dont' know what your functions do....this looks like it's setting some text boxes...is that what it is supposed to do? Or were you trying to update a database?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900