I used the code of Simon_Whale but still does not solve the problem when typing a sequence of characters the "matim" in Form2 that display information "manv" and "tennv" in two textbox in Form1 with the condition that "manv = matim ".
In the event of Form2 formload I have used the following command:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dbs.ConnectionString = MyConnectString
Dim sql As String = ""
Dim dt As New DataTable
sql = "select * from nhanvien"
truyvan(sql, dt)
Me.data_dulieu.DataSource = dt
Me.data_dulieu.Columns(0).Width = 100
Me.data_dulieu.Columns(1).Width = 300
Dim dong As Integer = data_dulieu.Rows.Count
For i As Integer = 0 To dong - 1
If data_dulieu.Rows(i).Cells("manv").Value = Form2.matim.Text Then
data_dulieu.Rows(i).Cells("manv").Selected = True
Exit For
End If
Next
End Sub
This means that each time form1 form2 start by calling it a weekly field checks "manv" of gridview and compared to the "matim" in Form2. if so, it will "select" on gridview row on the Form1.
The problem is that code is very reasonable that it is not just on the line a. hix. As predicted by the two strings of text you are at the "manv" of Form1 is separated is not the same string in textbox "matim" in Form2. (As in Form2 matim chain as more space is at the back)
So Pro can help me solve this problem a little more?
Who can edit the Project that I have sent mediafire link above and send me the link is excellent