これが私のコードです。vb.net に参加するのは初めてです。
Private Sub Accountnum_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Accountnum.KeyPress
Dim index As Long = 0
If Asc(e.KeyChar) = 13 Then
Do While index <= 111000
If Accountnum.Text = ds.Tables("dbo.AccountMaster").Rows(index).Item("AccountNumber").ToString Then
Nameconsumer.Text = ds.Tables("dbo.AccountMaster").Rows(index).Item("ConsumerName")
Address.Text = ds.Tables("dbo.AccountMaster").Rows(index).Item("ConsumerAddress")
End If
Loop
End If
End Sub