这是我在 ojt 中的项目。我在 ds(DataSet) 中遇到问题,错误说它为空,现在,我的问题是,我该如何解决这个问题?
Private Sub RefreshData()
If Not con.State = ConnectionState.Open Then
con.Open()
End If
Dim dt As New DataTable("SELECT ID as [ID], " & _
"fname as [NAME], lname " & _
"FROM asdf ORDER by ID")
If ds IsNot Nothing And ds.Tables("asdf") IsNot Nothing Then****this part is were i get the error***
da.Fill(dt, "asdf")
End If
con.Close()
maxrows = ds.Tables("asdf").Rows.Count
inc = -1
End Sub