I need help. I have a search button and 2 textboxes.Textbox1 should diplay the employee id when the search button is clicked (and it works fine).But I need to automatically see the employee name in textbox2, based on the employee id on textbox1.I'd really appreciate your help. Below is my code:
conn = New SqlConnection("Data Source=MAPOUNDS\SQLEXPRESS;Initial Catalog=HRManagementSystem;Integrated Security=True") conn.Open() selectQuery = "SELECT * FROM EmployeeRegistration WHERE EmpID Like '" + txtEmpId.Text + "' AND FullName = '" & txtEmpName.Text & "'" cmd = New SqlCommand(selectQuery, conn) dr = cmd.ExecuteReader If dr.Read Then txtEmpName.Text = txtEmpId.SelectedText("textbox2 should display employee name based on emp id entered on textbox1").
Edited 1 Year Ago by Reverend Jim: Corrected code formatting