这是我的代码。这是我第一次在 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