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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)