这是我的代码。这是我第一次在vb.net上。NullReferenceException不受管理。 “表”不返回任何内容。为什么?
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
在哪一行是错误? – sashkello 2013-04-18 03:06:13